diff --git a/.gitignore b/.gitignore index dfcb98a..684e521 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ biopython-1.54.tar.gz /biopython-1.69.tar.gz /biopython-biopython-170.tar.gz /biopython-biopython-171.tar.gz +/biopython-1.72.tar.gz diff --git a/python-biopython-bug1695.patch b/python-biopython-bug1695.patch deleted file mode 100644 index a356131..0000000 --- a/python-biopython-bug1695.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 1d4c4a16c49d95d3c52e77c1e62c687ec64b284d Mon Sep 17 00:00:00 2001 -From: peterjc -Date: Thu, 21 Jun 2018 14:29:31 +0100 -Subject: [PATCH 1/3] Avoid leaking StopIteration in Bio/bgzf.py - -Still using this as an internal end-of-file, thus -end-of-iteration signal, which is perhaps not ideal. - -See https://www.python.org/dev/peps/pep-0479/ ---- - Bio/bgzf.py | 15 +++++++++++---- - 1 file changed, 11 insertions(+), 4 deletions(-) - -diff --git a/Bio/bgzf.py b/Bio/bgzf.py -index efa6262afa..e539ec4905 100755 ---- a/Bio/bgzf.py -+++ b/Bio/bgzf.py -@@ -391,18 +391,25 @@ def BgzfBlocks(handle): - data_start = 0 - while True: - start_offset = handle.tell() -- # This may raise StopIteration which is perfect here -- block_length, data = _load_bgzf_block(handle) -+ try: -+ block_length, data = _load_bgzf_block(handle) -+ except StopIteration: -+ break - data_len = len(data) - yield start_offset, block_length, data_start, data_len - data_start += data_len - - - def _load_bgzf_block(handle, text_mode=False): -- """Load the next BGZF block of compressed data (PRIVATE).""" -+ """Load the next BGZF block of compressed data (PRIVATE). -+ -+ Returns a tuple (block size and data), or at end of file -+ will raise StopIteration. -+ """ - magic = handle.read(4) - if not magic: -- # End of file -+ # End of file - should we signal this differently now? -+ # See https://www.python.org/dev/peps/pep-0479/ - raise StopIteration - if magic != _bgzf_magic: - raise ValueError(r"A BGZF (e.g. a BAM file) block should start with " - -From 0694c396ef7988e3c032d27e86fb131257812687 Mon Sep 17 00:00:00 2001 -From: peterjc -Date: Thu, 21 Jun 2018 16:12:14 +0100 -Subject: [PATCH 2/3] Return None in generator functions, not StopIteration - -See https://www.python.org/dev/peps/pep-0479/ ---- - Bio/TogoWS/__init__.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Bio/TogoWS/__init__.py b/Bio/TogoWS/__init__.py -index 4018244bcf..3cf5309c8a 100644 ---- a/Bio/TogoWS/__init__.py -+++ b/Bio/TogoWS/__init__.py -@@ -199,7 +199,7 @@ def search_iter(db, query, limit=None, batch=100): - """ - count = search_count(db, query) - if not count: -- raise StopIteration -+ return - # NOTE - We leave it to TogoWS to enforce any upper bound on each - # batch, they currently return an HTTP 400 Bad Request if above 100. - remain = count - -From 86eb2275448da22aa6976c6c7c46f9779af95cf1 Mon Sep 17 00:00:00 2001 -From: peterjc -Date: Thu, 21 Jun 2018 16:22:51 +0100 -Subject: [PATCH 3/3] Fix Nexus StopIteration error under Python 3.7.0rc1 - -Reported as Biopython GitHub issue #1693 via Fedora -packaging work for Python 3.7. - -The StopIteration from the Nexus comment parsing could -propogate up to AlignIO and cause a failure there too. -See: - -https://github.com/biopython/biopython/issues/1693 - -This is in some way triggered by the changes for PEP479, -where inappropriate StopIteration exceptions get turned -into RuntimeError exceptions instead, see: - -https://www.python.org/dev/peps/pep-0479/ ---- - Bio/Nexus/Nexus.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Bio/Nexus/Nexus.py b/Bio/Nexus/Nexus.py -index 18b0a9f9c7..6faf95e569 100644 ---- a/Bio/Nexus/Nexus.py -+++ b/Bio/Nexus/Nexus.py -@@ -444,6 +444,8 @@ def _kill_comments_and_break_lines(text): - - NOTE: this function is very slow for large files, and obsolete when using C extension cnexus - """ -+ if not text: -+ return "" - contents = iter(text) - newtext = [] - newline = [] diff --git a/python-biopython.spec b/python-biopython.spec index 9c26e25..e362c70 100644 --- a/python-biopython.spec +++ b/python-biopython.spec @@ -17,14 +17,10 @@ %global module biopython Name: python-biopython -Version: 1.71 -Release: 5%{?dist} +Version: 1.72 +Release: 1%{?dist} Summary: Python tools for computational molecular biology -Source0: https://github.com/biopython/biopython/archive/biopython-171.tar.gz#/biopython-biopython-171.tar.gz - -# https://github.com/biopython/biopython/issues/1693 -# # https://github.com/biopython/biopython/issues/1695 -Patch0: python-biopython-bug1695.patch +Source0: https://files.pythonhosted.org/packages/source/b/%{module}/%{module}-%{version}.tar.gz # Starting from biopython-1.69, BioPython is released under the # "Biopython License Agreement"; it looks like a MIT variant @@ -125,7 +121,7 @@ PDF/HTML documentation of %{module}. %prep %setup -qc -mv %{module}-%{module}-171 python2 +mv %{module}-1.72 python2 pushd python2 # remove all execute bits from documentation and fix line endings @@ -141,9 +137,6 @@ popd %if 0%{?with_python3} cp -a python2 python3 -pushd python3 -%patch0 -p1 -popd %endif # with_python3 %build @@ -220,6 +213,9 @@ popd %license python2/LICENSE %changelog +* Sat Jun 30 2018 Antonio Trande - 1.72-1 +- Update to 1.72 + * Fri Jun 22 2018 Antonio Trande - 1.71-5 - Enable additional tests (upstream bug #855) - Enable DSSP test with Python2 diff --git a/sources b/sources index 7fcad34..9eee9ff 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (biopython-biopython-171.tar.gz) = 450f7e2aed09b8764b10268c98b9b824d63864c78cdccf4014e64f385850b870890ae915b56310bcb6da06df90728eeb59009ea78e32f221d86d70c043f1dc33 +SHA512 (biopython-1.72.tar.gz) = e2ce74f4533c9c779c8fbafb73ed562c890209a4318fc9d8616ec98670ee5e97649b8c1b0207c91454b923faecf375f20bd6a0aaff52ccc73268fb0b1ea0b44c