From e53717ca1183556abe78493cc2fc3fae40ecee71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 10 Mar 2021 15:36:55 +0100 Subject: [PATCH] pythonPackages.construct: add python2-compatible expression --- .../python-modules/construct/2.10.54.nix | 29 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 5 +++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/python-modules/construct/2.10.54.nix diff --git a/pkgs/development/python-modules/construct/2.10.54.nix b/pkgs/development/python-modules/construct/2.10.54.nix new file mode 100644 index 00000000000..6bb279490ab --- /dev/null +++ b/pkgs/development/python-modules/construct/2.10.54.nix @@ -0,0 +1,29 @@ +{ lib, stdenv, buildPythonPackage, fetchFromGitHub, pythonOlder +, six, pytestCheckHook, pytest-benchmark, enum34, numpy, arrow, ruamel_yaml +}: + +buildPythonPackage rec { + pname = "construct"; + version = "2.10.54"; + + # no tests in PyPI tarball + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "1mqspsn6bf3ibvih1zna2glkg8iw7vy5zg9gzg0d1m8zcndk2c48"; + }; + + checkInputs = [ pytestCheckHook pytest-benchmark enum34 numpy arrow ruamel_yaml ]; + + disabledTests = lib.optionals stdenv.isDarwin [ "test_multiprocessing" ]; + + pytestFlagsArray = [ "--benchmark-disable" ]; + + meta = with lib; { + description = "Powerful declarative parser (and builder) for binary data"; + homepage = "https://construct.readthedocs.org/"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c2473c7f821..e8a71295448 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1462,7 +1462,10 @@ in { constantly = callPackage ../development/python-modules/constantly { }; - construct = callPackage ../development/python-modules/construct { }; + construct = if isPy27 then + callPackage ../development/python-modules/construct/2.10.54.nix { } + else + callPackage ../development/python-modules/construct { }; consul = callPackage ../development/python-modules/consul { };