From 220c6d0879f9bdf9c54901ec43809717119c7f2d Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Fri, 8 Nov 2024 10:27:11 +0100 Subject: [PATCH 1/2] Revert "biopython: fix eval" This reverts commit 74ae5abbf1bccee90e13997fa68a2664a6a48bcd. --- pkgs/development/python-modules/biopython/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/biopython/default.nix b/pkgs/development/python-modules/biopython/default.nix index 2a3d3d0b86e3..900c3f019f28 100644 --- a/pkgs/development/python-modules/biopython/default.nix +++ b/pkgs/development/python-modules/biopython/default.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "biopython"; repo = "biopython"; - rev = "refs/tags/biopython-${lib.replaceStrings [ "." ] [ "" ] version}"; + rev = "refs/tags/biopython-${lib.replaceChars [ "." ] [ "" ] version}"; hash = "sha256-zXUB/AkWc/cY9M02WheSvXjT/nwM+lGXfXgCcWfu0G4="; }; From 95aa3d12c670528f16d01262cad53a2c199c8814 Mon Sep 17 00:00:00 2001 From: Markus Kowalewski Date: Fri, 8 Nov 2024 10:27:23 +0100 Subject: [PATCH 2/2] Revert "python3Packages.biopython: 1.83 -> 1.84" This reverts commit a30bd9c1992ddce61e9ecb4add359011fd30f669. --- .../biopython/close_parser_on_time.patch | 18 ++++++++++++++++++ .../python-modules/biopython/default.nix | 18 +++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/python-modules/biopython/close_parser_on_time.patch diff --git a/pkgs/development/python-modules/biopython/close_parser_on_time.patch b/pkgs/development/python-modules/biopython/close_parser_on_time.patch new file mode 100644 index 000000000000..05d22e22ed9e --- /dev/null +++ b/pkgs/development/python-modules/biopython/close_parser_on_time.patch @@ -0,0 +1,18 @@ +diff --git a/Bio/SeqIO/SeqXmlIO.py b/Bio/SeqIO/SeqXmlIO.py +index 8fe75ebb728..6758317d05f 100644 +--- a/Bio/SeqIO/SeqXmlIO.py ++++ b/Bio/SeqIO/SeqXmlIO.py +@@ -498,11 +498,12 @@ def iterate(self, handle): + if not text: + break + parser.feed(text) ++ # Closing the parser ensures that all XML data fed into it are processed ++ parser.close() + # We have reached the end of the XML file; + # send out the remaining records + yield from records + records.clear() +- parser.close() + + + class SeqXmlWriter(SequenceWriter): diff --git a/pkgs/development/python-modules/biopython/default.nix b/pkgs/development/python-modules/biopython/default.nix index 900c3f019f28..051f66845dec 100644 --- a/pkgs/development/python-modules/biopython/default.nix +++ b/pkgs/development/python-modules/biopython/default.nix @@ -1,7 +1,7 @@ { lib, buildPythonPackage, - fetchFromGitHub, + fetchPypi, pythonOlder, setuptools, numpy, @@ -9,18 +9,22 @@ buildPythonPackage rec { pname = "biopython"; - version = "1.84"; + version = "1.83"; pyproject = true; disabled = pythonOlder "3.9"; - src = fetchFromGitHub { - owner = "biopython"; - repo = "biopython"; - rev = "refs/tags/biopython-${lib.replaceChars [ "." ] [ "" ] version}"; - hash = "sha256-zXUB/AkWc/cY9M02WheSvXjT/nwM+lGXfXgCcWfu0G4="; + src = fetchPypi { + inherit pname version; + hash = "sha256-eOa/t43mMDQDev01/nfLbgqeW2Jwa+z3in2SKxbtg/c="; }; + patches = [ + # cherry-picked from https://github.com/biopython/biopython/commit/3f9bda7ef44f533dadbaa0de29ac21929bc0b2f1 + # fixes SeqXMLIO parser to process all data. remove on next update + ./close_parser_on_time.patch + ]; + build-system = [ setuptools ]; dependencies = [ numpy ];