From 5c8e26550e9e073743759a39e7f5e886908b6f0a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 29 Dec 2021 03:25:33 +0100 Subject: [PATCH] python3Packages.lz4: 3.1.10 -> 3.1.12 --- .../python-modules/lz4/default.nix | 69 +++++++++++++------ 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/lz4/default.nix b/pkgs/development/python-modules/lz4/default.nix index cc84fa75c699..9e2cc9b31e15 100644 --- a/pkgs/development/python-modules/lz4/default.nix +++ b/pkgs/development/python-modules/lz4/default.nix @@ -1,41 +1,68 @@ { lib , buildPythonPackage , fetchFromGitHub -, future -, isPy3k +, pythonOlder + +# native inputs , pkgconfig -, psutil -, pytest -, pytest-cov -, pytest-runner , setuptools-scm + +# tests +, psutil +, pytestCheckHook }: buildPythonPackage rec { pname = "python-lz4"; - version = "3.1.10"; + version = "3.1.12"; + format = "setuptools"; - # get full repository inorder to run tests + disabled = pythonOlder "3.5"; + + # get full repository in order to run tests src = fetchFromGitHub { owner = pname; repo = pname; - rev = version; - sha256 = "0a4gic8xh3simkk5k8302rxwf765pr6y63k3js79mkl983vpxcim"; + rev = "v${version}"; + sha256 = "sha256-fqt9aJGqZpfbiYtU8cmm7UQaixZwbTKFBwRfR1B/qic="; }; - nativeBuildInputs = [ setuptools-scm pkgconfig pytest-runner ]; - checkInputs = [ pytest pytest-cov psutil ]; - propagatedBuildInputs = lib.optionals (!isPy3k) [ future ]; + SETUPTOOLS_SCM_PRETEND_VERSION = version; - # give a hint to setuptools-scm on package version - preBuild = '' - export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}" + postPatch = '' + sed -i '/pytest-cov/d' setup.py ''; - meta = { - description = "LZ4 Bindings for Python"; - homepage = "https://github.com/python-lz4/python-lz4"; - license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ costrouc ]; + nativeBuildInputs = [ + setuptools-scm + pkgconfig + ]; + + pythonImportsCheck = [ + "lz4" + "lz4.block" + "lz4.frame" + "lz4.stream" + ]; + + checkInputs = [ + pytestCheckHook + psutil + ]; + + # leave build directory, so the installed library gets imported + preCheck = '' + pushd tests + ''; + + postCheck = '' + popd + ''; + + meta = with lib; { + description = "LZ4 Bindings for Python"; + homepage = "https://github.com/python-lz4/python-lz4"; + license = licenses.bsd3; + maintainers = with maintainers; [ costrouc ]; }; }