Merge pull request #310411 from getchoo/pkgs/biopython/fix-test

python3Packages.biopython: patch SeqXMLIO parser, refactor
This commit is contained in:
Martin Weinelt 2024-05-10 09:25:33 +02:00 committed by GitHub
commit 653ad634cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 12 deletions

View file

@ -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):

View file

@ -1,9 +1,10 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
, numpy
{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
setuptools,
numpy,
}:
buildPythonPackage rec {
@ -18,15 +19,17 @@ buildPythonPackage rec {
hash = "sha256-eOa/t43mMDQDev01/nfLbgqeW2Jwa+z3in2SKxbtg/c=";
};
nativeBuildInputs = [
setuptools
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
];
propagatedBuildInputs = [ numpy ];
build-system = [ setuptools ];
pythonImportsCheck = [
"Bio"
];
dependencies = [ numpy ];
pythonImportsCheck = [ "Bio" ];
checkPhase = ''
runHook preCheck