From 455be5c8bcf0da7033b8d1c09ee2b97c88213aef Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 2 May 2024 17:11:46 +0900 Subject: [PATCH 1/3] python311Packages.htseq: format with nixfmt --- .../python-modules/htseq/default.nix | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/htseq/default.nix b/pkgs/development/python-modules/htseq/default.nix index 9d69a8bfef54..1e95f31739b8 100644 --- a/pkgs/development/python-modules/htseq/default.nix +++ b/pkgs/development/python-modules/htseq/default.nix @@ -1,4 +1,15 @@ -{ lib, buildPythonPackage, fetchFromGitHub, cython, numpy, pysam, matplotlib, python, isPy27, isPy3k }: +{ + lib, + buildPythonPackage, + fetchFromGitHub, + cython, + numpy, + pysam, + matplotlib, + python, + isPy27, + isPy3k, +}: buildPythonPackage rec { version = "0.12.4"; format = "setuptools"; @@ -12,13 +23,19 @@ buildPythonPackage rec { }; nativeBuildInputs = [ cython ]; - propagatedBuildInputs = [ numpy pysam matplotlib ]; + propagatedBuildInputs = [ + numpy + pysam + matplotlib + ]; - checkPhase = lib.optionalString isPy27 '' - ${python.interpreter} python2/test/test_general.py - '' + lib.optionalString isPy3k '' - ${python.interpreter} python3/test/test_general.py - ''; + checkPhase = + lib.optionalString isPy27 '' + ${python.interpreter} python2/test/test_general.py + '' + + lib.optionalString isPy3k '' + ${python.interpreter} python3/test/test_general.py + ''; meta = with lib; { homepage = "https://htseq.readthedocs.io/"; From 1a9e2e0b2ff07c5d8e87bd54c2fd47f356f70ac9 Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 2 May 2024 17:16:07 +0900 Subject: [PATCH 2/3] python311Packages.htseq: add update script --- pkgs/development/python-modules/htseq/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/htseq/default.nix b/pkgs/development/python-modules/htseq/default.nix index 1e95f31739b8..6e36c7dd53de 100644 --- a/pkgs/development/python-modules/htseq/default.nix +++ b/pkgs/development/python-modules/htseq/default.nix @@ -9,6 +9,7 @@ python, isPy27, isPy3k, + nix-update-script, }: buildPythonPackage rec { version = "0.12.4"; @@ -37,6 +38,13 @@ buildPythonPackage rec { ${python.interpreter} python3/test/test_general.py ''; + passthru.updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "release_(.+)" + ]; + }; + meta = with lib; { homepage = "https://htseq.readthedocs.io/"; description = "A framework to work with high-throughput sequencing data"; From 586d563fe2f611d3eb1bfe6fbbbabee4dfceefa1 Mon Sep 17 00:00:00 2001 From: natsukium Date: Thu, 2 May 2024 17:16:25 +0900 Subject: [PATCH 3/3] python311Packages.htseq: 0.12.4 -> 2.0.4 Diff: https://github.com/htseq/htseq/compare/release_0.12.4...release_2.0.4 --- .../python-modules/htseq/default.nix | 67 +++++++++++++------ 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/pkgs/development/python-modules/htseq/default.nix b/pkgs/development/python-modules/htseq/default.nix index 6e36c7dd53de..caa47f5197d6 100644 --- a/pkgs/development/python-modules/htseq/default.nix +++ b/pkgs/development/python-modules/htseq/default.nix @@ -2,41 +2,67 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch, + swig, cython, - numpy, - pysam, matplotlib, - python, - isPy27, - isPy3k, + numpy, + pandas, + pysam, + setuptools, + pytestCheckHook, nix-update-script, }: buildPythonPackage rec { - version = "0.12.4"; - format = "setuptools"; pname = "htseq"; + version = "2.0.4"; + pyproject = true; src = fetchFromGitHub { owner = "htseq"; repo = "htseq"; rev = "release_${version}"; - sha256 = "0y7vh249sljqjnv81060w4xkdx6f1y5zdqkh38yk926x6v9riijm"; + hash = "sha256-7ocrmuj9LOtPz9XbI5rKGcdE5JbFz/pZh00Nie65XxE="; }; - nativeBuildInputs = [ cython ]; - propagatedBuildInputs = [ - numpy - pysam - matplotlib + patches = [ + # https://github.com/htseq/htseq/pull/84 + (fetchpatch { + name = "replace-distutils-with-sysconfig.patch"; + url = "https://github.com/htseq/htseq/commit/f0f1e464ee9aee56f0b44f905e7b3355b0bb8f29.patch"; + hash = "sha256-yDYkXCPy+YFgnk1rnXwCB998aZwVd5nJeejZIgeEzAo="; + }) ]; - checkPhase = - lib.optionalString isPy27 '' - ${python.interpreter} python2/test/test_general.py - '' - + lib.optionalString isPy3k '' - ${python.interpreter} python3/test/test_general.py - ''; + nativeBuildInputs = [ swig ]; + + build-system = [ + cython + numpy + pysam + setuptools + ]; + + dependencies = [ + numpy + pysam + ]; + + optional-dependencies = { + htseq-qa = [ matplotlib ]; + }; + + pythonImportsCheck = [ "HTSeq" ]; + + nativeCheckInputs = [ + pandas + pytestCheckHook + ] ++ optional-dependencies.htseq-qa; + + preCheck = '' + rm -r src HTSeq + export PATH=$out/bin:$PATH + ''; passthru.updateScript = nix-update-script { extraArgs = [ @@ -49,6 +75,5 @@ buildPythonPackage rec { homepage = "https://htseq.readthedocs.io/"; description = "A framework to work with high-throughput sequencing data"; maintainers = with maintainers; [ unode ]; - platforms = platforms.unix; }; }