From f69aae0bcba00be63d08e9bd18b7b9736d6ea6f1 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 3 Jul 2021 22:17:31 +0200 Subject: [PATCH 1/2] python3Packages.bson: init at 0.5.10 --- .../python-modules/bson/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/bson/default.nix diff --git a/pkgs/development/python-modules/bson/default.nix b/pkgs/development/python-modules/bson/default.nix new file mode 100644 index 00000000000..ca78b0806f0 --- /dev/null +++ b/pkgs/development/python-modules/bson/default.nix @@ -0,0 +1,33 @@ +{ lib +, buildPythonPackage +, fetchPypi +, python-dateutil +, six +}: + +buildPythonPackage rec { + pname = "bson"; + version = "0.5.10"; + + src = fetchPypi { + inherit pname version; + sha256 = "14355m3dchz446fl54ym78bn4wi20hddx1614f8rl4sin0m1nlfn"; + }; + + propagatedBuildInputs = [ + python-dateutil + six + ]; + + # 0.5.10 was not tagged, https://github.com/py-bson/bson/issues/108 + doCheck = false; + + pythonImportsCheck = [ "bson" ]; + + meta = with lib; { + description = "BSON codec for Python"; + homepage = "https://github.com/py-bson/bson"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 89cfeeeaad1..db00b806fb1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1218,6 +1218,8 @@ in { bsblan = callPackage ../development/python-modules/bsblan { }; + bson = callPackage ../development/python-modules/bson { }; + btchip = callPackage ../development/python-modules/btchip { }; bt_proximity = callPackage ../development/python-modules/bt-proximity { }; From cb1c6efd0886c10c2abd36b20e1cb35369ccf5b9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 4 Jul 2021 00:02:07 +0200 Subject: [PATCH 2/2] python3Packages.cattrs: 1.1.2 -> 1.7.0 --- .../python-modules/cattrs/default.nix | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/cattrs/default.nix b/pkgs/development/python-modules/cattrs/default.nix index a48e29b827b..7f51c89e3e4 100644 --- a/pkgs/development/python-modules/cattrs/default.nix +++ b/pkgs/development/python-modules/cattrs/default.nix @@ -1,27 +1,70 @@ { lib , attrs +, bson , buildPythonPackage , fetchFromGitHub , hypothesis +, immutables +, msgpack +, poetry-core , pytestCheckHook +, pyyaml +, tomlkit +, ujson }: buildPythonPackage rec { pname = "cattrs"; - version = "1.1.2"; + version = "1.7.0"; + format = "pyproject"; src = fetchFromGitHub { owner = "Tinche"; repo = pname; rev = "v${version}"; - sha256 = "083d5mi6x7qcl26wlvwwn7gsp5chxlxkh4rp3a41w8cfwwr3h6l8"; + sha256 = "sha256-7F4S4IeApbULXhkEZ0oab3Y7sk20Ag2fCYxsyi4WbWw="; }; - propagatedBuildInputs = [ attrs ]; + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + attrs + ]; checkInputs = [ + bson hypothesis + immutables + msgpack pytestCheckHook + pyyaml + tomlkit + ujson + ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "-l --benchmark-sort=fullname --benchmark-warmup=true --benchmark-warmup-iterations=5 --benchmark-group-by=fullname" "" + substituteInPlace pyproject.toml \ + --replace 'orjson = "^3.5.2"' "" + substituteInPlace tests/test_preconf.py \ + --replace "from orjson import dumps as orjson_dumps" "" \ + --replace "from orjson import loads as orjson_loads" "" + ''; + + disabledTestPaths = [ + # Don't run benchmarking tests + "bench/test_attrs_collections.py" + "bench/test_attrs_nested.py" + "bench/test_attrs_primitives.py" + "bench/test_primitives.py" + ]; + + disabledTests = [ + # orjson is not available as it requires Rust nightly features to compile its requirements + "test_orjson" ]; pythonImportsCheck = [ "cattr" ];