From 5b9de10b9e440b82a9a682a844e3d1abf93f76fb Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 14 Jan 2024 11:24:25 +0900 Subject: [PATCH] python311Packages.biopython: enable tests and refactor --- .../python-modules/biopython/default.nix | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/biopython/default.nix b/pkgs/development/python-modules/biopython/default.nix index c56584be69d5c..96470da22491e 100644 --- a/pkgs/development/python-modules/biopython/default.nix +++ b/pkgs/development/python-modules/biopython/default.nix @@ -1,25 +1,42 @@ { lib , buildPythonPackage , fetchPypi +, pythonOlder +, setuptools , numpy -, isPy3k }: buildPythonPackage rec { pname = "biopython"; version = "1.83"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.9"; src = fetchPypi { inherit pname version; hash = "sha256-eOa/t43mMDQDev01/nfLbgqeW2Jwa+z3in2SKxbtg/c="; }; - disabled = !isPy3k; + nativeBuildInputs = [ + setuptools + ]; propagatedBuildInputs = [ numpy ]; - # Checks try to write to $HOME, which does not work with nix - doCheck = false; + + pythonImportsCheck = [ + "Bio" + ]; + + checkPhase = '' + runHook preCheck + + cd Tests + python run_tests.py --offline + + runHook postCheck + ''; + meta = { description = "Python library for bioinformatics"; longDescription = ''