1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hypothesis,
6 poetry-core,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "collections-extended";
12 version = "2.0.2";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "mlenzen";
17 repo = "collections-extended";
18 tag = "v${version}";
19 hash = "sha256-cK13+CQUELKSiLpG747+C+RB5b6luu0mWLLXTT+uGH4=";
20 };
21
22 # shuffle's random option has been removed in python 3.11
23 postPatch = ''
24 substituteInPlace collections_extended/setlists.py \
25 --replace-fail \
26 "random_.shuffle(self._list, random=random)" \
27 "random_.shuffle(self._list)"
28 '';
29
30 build-system = [ poetry-core ];
31
32 nativeCheckInputs = [
33 hypothesis
34 pytestCheckHook
35 ];
36
37 pythonImportsCheck = [ "collections_extended" ];
38
39 meta = {
40 description = "Extra Python Collections - bags (multisets), setlists (unique list/indexed set), RangeMap and IndexedDict";
41 homepage = "https://github.com/mlenzen/collections-extended";
42 changelog = "https://github.com/mlenzen/collections-extended/releases/tag/v${version}";
43 license = lib.licenses.asl20;
44 maintainers = with lib.maintainers; [ exarkun ];
45 };
46}