git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #129181 from fabaff/bump-cattrs
commit703f8b5afbe74f4bf8874b15b4eee64674507073 authorSandro <sandro.jaeckel@gmail.com> dateTue 6 Jul 2021, 02:41 (5 years ago) parent411587fcb1c6ef
3 files changed+81−3
pkgs/development/python-modules/bson/default.nix+33 pkgs/development/python-modules/cattrs/default.nix+46−3 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/bson/default.nixnew file+33
@@ -0,0 +1,33 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, python-dateutil
5+, six
6+}:
7+
8+buildPythonPackage rec {
9+ pname = "bson";
10+ version = "0.5.10";
11+
12+ src = fetchPypi {
13+ inherit pname version;
14+ sha256 = "14355m3dchz446fl54ym78bn4wi20hddx1614f8rl4sin0m1nlfn";
15+ };
16+
17+ propagatedBuildInputs = [
18+ python-dateutil
19+ six
20+ ];
21+
22+ # 0.5.10 was not tagged, https://github.com/py-bson/bson/issues/108
23+ doCheck = false;
24+
25+ pythonImportsCheck = [ "bson" ];
26+
27+ meta = with lib; {
28+ description = "BSON codec for Python";
29+ homepage = "https://github.com/py-bson/bson";
30+ license = licenses.asl20;
31+ maintainers = with maintainers; [ fab ];
32+ };
33+}
pkgs/development/python-modules/cattrs/default.nix+46−3
@@ -1,27 +1,70 @@
11{ lib
22, attrs
3+, bson
34, buildPythonPackage
45, fetchFromGitHub
56, hypothesis
7+, immutables
8+, msgpack
9+, poetry-core
610, pytestCheckHook
11+, pyyaml
12+, tomlkit
13+, ujson
714}:
815
916buildPythonPackage rec {
1017 pname = "cattrs";
11− version = "1.1.2";
18+ version = "1.7.0";
19+ format = "pyproject";
1220
1321 src = fetchFromGitHub {
1422 owner = "Tinche";
1523 repo = pname;
1624 rev = "v${version}";
17− sha256 = "083d5mi6x7qcl26wlvwwn7gsp5chxlxkh4rp3a41w8cfwwr3h6l8";
25+ sha256 = "sha256-7F4S4IeApbULXhkEZ0oab3Y7sk20Ag2fCYxsyi4WbWw=";
1826 };
1927
20− propagatedBuildInputs = [ attrs ];
28+ nativeBuildInputs = [
29+ poetry-core
30+ ];
31+
32+ propagatedBuildInputs = [
33+ attrs
34+ ];
2135
2236 checkInputs = [
37+ bson
2338 hypothesis
39+ immutables
40+ msgpack
2441 pytestCheckHook
42+ pyyaml
43+ tomlkit
44+ ujson
45+ ];
46+
47+ postPatch = ''
48+ substituteInPlace setup.cfg \
49+ --replace "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warmup-iterations=5 --benchmark-group-by=fullname" ""
50+ substituteInPlace pyproject.toml \
51+ --replace 'orjson = "^3.5.2"' ""
52+ substituteInPlace tests/test_preconf.py \
53+ --replace "from orjson import dumps as orjson_dumps" "" \
54+ --replace "from orjson import loads as orjson_loads" ""
55+ '';
56+
57+ disabledTestPaths = [
58+ # Don't run benchmarking tests
59+ "bench/test_attrs_collections.py"
60+ "bench/test_attrs_nested.py"
61+ "bench/test_attrs_primitives.py"
62+ "bench/test_primitives.py"
63+ ];
64+
65+ disabledTests = [
66+ # orjson is not available as it requires Rust nightly features to compile its requirements
67+ "test_orjson"
2568 ];
2669
2770 pythonImportsCheck = [ "cattr" ];
pkgs/top-level/python-packages.nix+2
@@ -1218,6 +1218,8 @@ in {
12181218
12191219 bsblan = callPackage ../development/python-modules/bsblan { };
12201220
1221+ bson = callPackage ../development/python-modules/bson { };
1222+
12211223 btchip = callPackage ../development/python-modules/btchip { };
12221224
12231225 bt-proximity = callPackage ../development/python-modules/bt-proximity { };