From 2b4c0b8c2cafee37eaacff0c33b7a60419db067b Mon Sep 17 00:00:00 2001 From: sagitter Date: Aug 27 2016 10:51:02 +0000 Subject: Update to 1.68 --- diff --git a/.gitignore b/.gitignore index 17628b3..f0e606b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ biopython-1.54.tar.gz /biopython-1.65.tar.gz /biopython-1.66.tar.gz /biopython-biopython-167.tar.gz +/biopython-1.68.tar.gz diff --git a/python-biopython-split_online_test.patch b/python-biopython-split_online_test.patch deleted file mode 100644 index 735c06e..0000000 --- a/python-biopython-split_online_test.patch +++ /dev/null @@ -1,515 +0,0 @@ -From 762146ea0bd810020e17006ad957c57c18886af2 Mon Sep 17 00:00:00 2001 -From: ctSkennerton -Date: Sat, 14 May 2016 15:28:30 -0700 -Subject: [PATCH] Split online tests for BioSQL - -We need internet access for NCBI Entrez to load taxonomy -information automatically. - -Based on a pull request from @ctSkennerton which was updated -by @peterjc following changes on the master branch, with some -painful workarounds for global BioSQL configuration variables. ---- - Tests/common_BioSQL.py | 69 +++-------------- - Tests/common_BioSQL_online.py | 111 ++++++++++++++++++++++++++++ - Tests/test_BioSQL_MySQLdb.py | 2 +- - Tests/test_BioSQL_MySQLdb_online.py | 23 ++++++ - Tests/test_BioSQL_mysql_connector.py | 2 +- - Tests/test_BioSQL_mysql_connector_online.py | 23 ++++++ - Tests/test_BioSQL_psycopg2.py | 2 +- - Tests/test_BioSQL_psycopg2_online.py | 22 ++++++ - Tests/test_BioSQL_sqlite3.py | 2 +- - Tests/test_BioSQL_sqlite3_online.py | 27 +++++++ - 10 files changed, 221 insertions(+), 62 deletions(-) - create mode 100644 Tests/common_BioSQL_online.py - create mode 100644 Tests/test_BioSQL_MySQLdb_online.py - create mode 100644 Tests/test_BioSQL_mysql_connector_online.py - create mode 100644 Tests/test_BioSQL_psycopg2_online.py - create mode 100644 Tests/test_BioSQL_sqlite3_online.py - -diff --git a/Tests/common_BioSQL.py b/Tests/common_BioSQL.py -index 5cc00eb..834bf64 100644 ---- a/Tests/common_BioSQL.py -+++ b/Tests/common_BioSQL.py -@@ -174,7 +174,10 @@ def _do_db_create(): - - - def create_database(): -- """Delete any existing BioSQL test DB, then (re)create an empty BioSQL DB.""" -+ """Delete any existing BioSQL test DB, then (re)create an empty BioSQL DB. -+ -+ Returns TESTDB name which will change for for SQLite. -+ """ - if DBDRIVER in ["sqlite3"]: - global TESTDB - if os.path.exists(TESTDB): -@@ -208,6 +211,8 @@ def create_database(): - server.close() - raise - -+ return TESTDB -+ - - def destroy_database(): - """Delete any temporary BioSQL sqlite3 database files.""" -@@ -222,7 +227,7 @@ def load_database(gb_filename_or_handle): - This is useful for running tests against a newly created database. - """ - -- create_database() -+ TESTDB = create_database() - # now open a connection to load the database - db_name = "biosql-test" - server = BioSeqDatabase.open_database(driver=DBDRIVER, -@@ -245,7 +250,7 @@ def load_multi_database(gb_filename_or_handle, gb_filename_or_handle2): - This is useful for running tests against a newly created database. - """ - -- create_database() -+ TESTDB = create_database() - # now open a connection to load the database - db_name = "biosql-test" - db_name2 = "biosql-test2" -@@ -561,7 +566,7 @@ class LoaderTest(unittest.TestCase): - - def setUp(self): - # create TESTDB -- create_database() -+ TESTDB = create_database() - - # load the database - db_name = "biosql-test" -@@ -610,58 +615,6 @@ def test_load_database(self): - 'M81224.1', 'X55053.1', 'X62281.1']) - - --class TaxonomyTest(unittest.TestCase): -- """Test proper insertion and retrieval of taxonomy data -- """ -- def setUp(self): -- from Bio import Entrez -- Entrez.email = "biopython-dev@biopython.org" -- # create TESTDB -- create_database() -- -- # load the database -- db_name = "biosql-test" -- self.server = BioSeqDatabase.open_database(driver=DBDRIVER, -- user=DBUSER, passwd=DBPASSWD, -- host=DBHOST, db=TESTDB) -- -- # remove the database if it already exists -- try: -- self.server[db_name] -- self.server.remove_database(db_name) -- except KeyError: -- pass -- -- self.db = self.server.new_database(db_name) -- -- # get the GenBank file we are going to put into it -- self.iterator = SeqIO.parse("GenBank/cor6_6.gb", "gb") -- -- def tearDown(self): -- self.server.close() -- destroy_database() -- del self.db -- del self.server -- -- def test_taxon_left_right_values(self): -- self.db.load(self.iterator, True) -- sql = """SELECT DISTINCT include.ncbi_taxon_id FROM taxon -- INNER JOIN taxon AS include ON -- (include.left_value BETWEEN taxon.left_value -- AND taxon.right_value) -- WHERE taxon.taxon_id IN -- (SELECT taxon_id FROM taxon_name -- WHERE name = 'Brassicales') -- AND include.right_value - include.left_value = 1""" -- -- rows = self.db.adaptor.execute_and_fetchall(sql) -- self.assertEqual(4, len(rows)) -- values = set() -- for row in rows: -- values.add(row[0]) -- self.assertEqual(set([3704, 3711, 3708, 3702]), set(values)) -- -- - class DeleteTest(unittest.TestCase): - """Test proper deletion of entries from a database.""" - -@@ -729,7 +682,7 @@ class DupLoadTest(unittest.TestCase): - - def setUp(self): - # drop any old database and create a new one: -- create_database() -+ TESTDB = create_database() - # connect to new database: - self.server = BioSeqDatabase.open_database(driver=DBDRIVER, - user=DBUSER, passwd=DBPASSWD, -@@ -880,7 +833,7 @@ class TransferTest(unittest.TestCase): - # simply a new unique namespace is used for each test. - - def setUp(self): -- create_database() -+ TESTDB = create_database() - - def test_NC_005816(self): - """GenBank file to BioSQL, then again to a new namespace, NC_005816.""" -diff --git a/Tests/common_BioSQL_online.py b/Tests/common_BioSQL_online.py -new file mode 100644 -index 0000000..47db6c9 ---- /dev/null -+++ b/Tests/common_BioSQL_online.py -@@ -0,0 +1,111 @@ -+# This code is part of the Biopython distribution and governed by its -+# license. Please see the LICENSE file that should have been included -+# as part of this package. -+"""Tests for dealing with storage of biopython objects in a relational db. -+""" -+from __future__ import print_function -+ -+import os -+import platform -+import unittest -+import tempfile -+import time -+ -+from Bio._py3k import StringIO -+from Bio._py3k import zip -+from Bio._py3k import basestring -+ -+# Hide annoying warnings from things like bonds in GenBank features, -+# or PostgreSQL schema rules. TODO - test these warnings are raised! -+import warnings -+from Bio import BiopythonWarning -+ -+# local stuff -+from Bio import MissingExternalDependencyError -+from Bio.Seq import Seq, MutableSeq -+from Bio.SeqFeature import SeqFeature -+from Bio import Alphabet -+from Bio import SeqIO -+from Bio.SeqRecord import SeqRecord -+ -+from BioSQL import BioSeqDatabase -+from BioSQL import BioSeq -+from Bio import Entrez -+ -+from common_BioSQL import create_database, destroy_database, check_config -+ -+from seq_tests_common import compare_record, compare_records -+ -+import requires_internet -+ -+if __name__ == "__main__": -+ raise RuntimeError("Call this via test_BioSQL_*online.py not directly") -+ -+# Sharing these with test_BioSQL_XXX_online.py files which import this file: -+# DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB, DBSCHEMA, SQL_FILE, SYSTEM -+SYSTEM = platform.system() -+ -+ -+def share_config(dbdriver, dbtype, dbhost, dbuser, dbpasswd, testdb): -+ """Make sure we can access the DB settings from this file.""" -+ global DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB, DBSCHEMA -+ global SYSTEM, SQL_FILE -+ DBDRIVER = dbdriver -+ DBTYPE = dbtype -+ DBHOST = dbhost -+ DBUSER = dbuser -+ DBPASSWD = dbpasswd -+ TESTDB = testdb -+ -+ -+class TaxonomyTest(unittest.TestCase): -+ """Test proper insertion and retrieval of taxonomy data.""" -+ def setUp(self): -+ global DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB, DBSCHEMA -+ global SYSTEM, SQL_FILE -+ -+ Entrez.email = "biopython-dev@biopython.org" -+ # create TESTDB -+ TESTDB = create_database() -+ -+ # load the database -+ db_name = "biosql-test" -+ self.server = BioSeqDatabase.open_database(driver=DBDRIVER, -+ user=DBUSER, passwd=DBPASSWD, -+ host=DBHOST, db=TESTDB) -+ -+ # remove the database if it already exists -+ try: -+ self.server[db_name] -+ self.server.remove_database(db_name) -+ except KeyError: -+ pass -+ -+ self.db = self.server.new_database(db_name) -+ -+ # get the GenBank file we are going to put into it -+ self.iterator = SeqIO.parse("GenBank/cor6_6.gb", "gb") -+ -+ def tearDown(self): -+ self.server.close() -+ destroy_database() -+ del self.db -+ del self.server -+ -+ def test_taxon_left_right_values(self): -+ self.db.load(self.iterator, True) -+ sql = """SELECT DISTINCT include.ncbi_taxon_id FROM taxon -+ INNER JOIN taxon AS include ON -+ (include.left_value BETWEEN taxon.left_value -+ AND taxon.right_value) -+ WHERE taxon.taxon_id IN -+ (SELECT taxon_id FROM taxon_name -+ WHERE name = 'Brassicales') -+ AND include.right_value - include.left_value = 1""" -+ -+ rows = self.db.adaptor.execute_and_fetchall(sql) -+ self.assertEqual(4, len(rows)) -+ values = set() -+ for row in rows: -+ values.add(row[0]) -+ self.assertEqual(set([3704, 3711, 3708, 3702]), set(values)) -diff --git a/Tests/test_BioSQL_MySQLdb.py b/Tests/test_BioSQL_MySQLdb.py -index 2996e0d..f6abf4f 100644 ---- a/Tests/test_BioSQL_MySQLdb.py -+++ b/Tests/test_BioSQL_MySQLdb.py -@@ -19,7 +19,7 @@ - - # Some of the unit tests don't create their own database, - # so just in case there is no database already: --create_database() -+TESTDB = create_database() - - if __name__ == "__main__": - # Run the test cases -diff --git a/Tests/test_BioSQL_MySQLdb_online.py b/Tests/test_BioSQL_MySQLdb_online.py -new file mode 100644 -index 0000000..69a4237 ---- /dev/null -+++ b/Tests/test_BioSQL_MySQLdb_online.py -@@ -0,0 +1,23 @@ -+#!/usr/bin/env python -+# This code is part of the Biopython distribution and governed by its -+# license. Please see the LICENSE file that should have been included -+# as part of this package. -+ -+"""Run BioSQL tests using SQLite""" -+ -+from common_BioSQL import load_biosql_ini -+from common_BioSQL_online import * -+ -+DBDRIVER = 'MySQLdb' -+DBTYPE = 'mysql' -+ -+DBHOST, DBUSER, DBPASSWD, TESTDB = load_biosql_ini(DBTYPE) -+ -+# This will abort if driver not installed etc: -+check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+share_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+ -+if __name__ == "__main__": -+ # Run the test cases -+ runner = unittest.TextTestRunner(verbosity=2) -+ unittest.main(testRunner=runner) -diff --git a/Tests/test_BioSQL_mysql_connector.py b/Tests/test_BioSQL_mysql_connector.py -index fa1185d..0b3bda8 100644 ---- a/Tests/test_BioSQL_mysql_connector.py -+++ b/Tests/test_BioSQL_mysql_connector.py -@@ -15,7 +15,7 @@ - DBHOST, DBUSER, DBPASSWD, TESTDB = load_biosql_ini(DBTYPE) - - # This will abort if driver not installed etc: --check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+TESTDB = check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) - - # Some of the unit tests don't create their own database, - # so just in case there is no database already: -diff --git a/Tests/test_BioSQL_mysql_connector_online.py b/Tests/test_BioSQL_mysql_connector_online.py -new file mode 100644 -index 0000000..a1a5fc3 ---- /dev/null -+++ b/Tests/test_BioSQL_mysql_connector_online.py -@@ -0,0 +1,23 @@ -+#!/usr/bin/env python -+# This code is part of the Biopython distribution and governed by its -+# license. Please see the LICENSE file that should have been included -+# as part of this package. -+ -+"""Run BioSQL tests using SQLite""" -+ -+from common_BioSQL import load_biosql_ini -+from common_BioSQL_online import * -+ -+DBDRIVER = 'mysql.connector' -+DBTYPE = 'mysql' -+ -+DBHOST, DBUSER, DBPASSWD, TESTDB = load_biosql_ini(DBTYPE) -+ -+# This will abort if driver not installed etc: -+check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+share_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+ -+if __name__ == "__main__": -+ # Run the test cases -+ runner = unittest.TextTestRunner(verbosity=2) -+ unittest.main(testRunner=runner) -diff --git a/Tests/test_BioSQL_psycopg2.py b/Tests/test_BioSQL_psycopg2.py -index bc14248..76472a3 100644 ---- a/Tests/test_BioSQL_psycopg2.py -+++ b/Tests/test_BioSQL_psycopg2.py -@@ -18,7 +18,7 @@ - - # Some of the unit tests don't create their own database, - # so just in case there is no database already: --create_database() -+TESTDB = create_database() - - if __name__ == "__main__": - # Run the test cases -diff --git a/Tests/test_BioSQL_psycopg2_online.py b/Tests/test_BioSQL_psycopg2_online.py -new file mode 100644 -index 0000000..4e6ddbf ---- /dev/null -+++ b/Tests/test_BioSQL_psycopg2_online.py -@@ -0,0 +1,22 @@ -+#!/usr/bin/env python -+# This code is part of the Biopython distribution and governed by its -+# license. Please see the LICENSE file that should have been included -+# as part of this package. -+ -+"""Run BioSQL tests using PostgreSQL""" -+ -+from common_BioSQL import load_biosql_ini -+from common_BioSQL_online import * -+ -+DBDRIVER = 'psycopg2' -+DBTYPE = 'pg' -+DBHOST, DBUSER, DBPASSWD, TESTDB = load_biosql_ini(DBTYPE) -+ -+# This will abort if driver not installed etc: -+check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+share_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+ -+if __name__ == "__main__": -+ # Run the test cases -+ runner = unittest.TextTestRunner(verbosity=2) -+ unittest.main(testRunner=runner) -diff --git a/Tests/test_BioSQL_sqlite3.py b/Tests/test_BioSQL_sqlite3.py -index 0b03c91..678e066 100644 ---- a/Tests/test_BioSQL_sqlite3.py -+++ b/Tests/test_BioSQL_sqlite3.py -@@ -26,7 +26,7 @@ - - # Some of the unit tests don't create their own database, - # so just in case there is no database already: --create_database() -+TESTDB = create_database() - - - if False: -diff --git a/Tests/test_BioSQL_sqlite3_online.py b/Tests/test_BioSQL_sqlite3_online.py -new file mode 100644 -index 0000000..71dd935 ---- /dev/null -+++ b/Tests/test_BioSQL_sqlite3_online.py -@@ -0,0 +1,27 @@ -+#!/usr/bin/env python -+# This code is part of the Biopython distribution and governed by its -+# license. Please see the LICENSE file that should have been included -+# as part of this package. -+ -+"""Run BioSQL tests using SQLite""" -+ -+from common_BioSQL import temp_db_filename -+from common_BioSQL_online import * -+ -+# Constants for the database driver -+DBDRIVER = 'sqlite3' -+DBTYPE = 'sqlite' -+ -+DBHOST = None -+DBUSER = 'root' -+DBPASSWD = None -+TESTDB = temp_db_filename() -+ -+# This will abort if driver not installed etc: -+check_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+share_config(DBDRIVER, DBTYPE, DBHOST, DBUSER, DBPASSWD, TESTDB) -+ -+if __name__ == "__main__": -+ # Run the test cases -+ runner = unittest.TextTestRunner(verbosity=2) -+ unittest.main(testRunner=runner) -From 513192e0e88a09ac211263dea02fee82545cfa45 Mon Sep 17 00:00:00 2001 -From: Peter Cock -Date: Thu, 9 Jun 2016 10:11:59 +0100 -Subject: [PATCH] Skip these test with run_tests.py --offline - ---- - Tests/test_BioSQL_MySQLdb_online.py | 3 +++ - Tests/test_BioSQL_mysql_connector_online.py | 3 +++ - Tests/test_BioSQL_psycopg2_online.py | 3 +++ - Tests/test_BioSQL_sqlite3_online.py | 3 +++ - 4 files changed, 12 insertions(+) - -diff --git a/Tests/test_BioSQL_MySQLdb_online.py b/Tests/test_BioSQL_MySQLdb_online.py -index 69a4237..fde9886 100644 ---- a/Tests/test_BioSQL_MySQLdb_online.py -+++ b/Tests/test_BioSQL_MySQLdb_online.py -@@ -8,6 +8,9 @@ - from common_BioSQL import load_biosql_ini - from common_BioSQL_online import * - -+import requires_internet -+requires_internet.check() -+ - DBDRIVER = 'MySQLdb' - DBTYPE = 'mysql' - -diff --git a/Tests/test_BioSQL_mysql_connector_online.py b/Tests/test_BioSQL_mysql_connector_online.py -index a1a5fc3..5b71624 100644 ---- a/Tests/test_BioSQL_mysql_connector_online.py -+++ b/Tests/test_BioSQL_mysql_connector_online.py -@@ -8,6 +8,9 @@ - from common_BioSQL import load_biosql_ini - from common_BioSQL_online import * - -+import requires_internet -+requires_internet.check() -+ - DBDRIVER = 'mysql.connector' - DBTYPE = 'mysql' - -diff --git a/Tests/test_BioSQL_psycopg2_online.py b/Tests/test_BioSQL_psycopg2_online.py -index 4e6ddbf..0fe3859 100644 ---- a/Tests/test_BioSQL_psycopg2_online.py -+++ b/Tests/test_BioSQL_psycopg2_online.py -@@ -8,6 +8,9 @@ - from common_BioSQL import load_biosql_ini - from common_BioSQL_online import * - -+import requires_internet -+requires_internet.check() -+ - DBDRIVER = 'psycopg2' - DBTYPE = 'pg' - DBHOST, DBUSER, DBPASSWD, TESTDB = load_biosql_ini(DBTYPE) -diff --git a/Tests/test_BioSQL_sqlite3_online.py b/Tests/test_BioSQL_sqlite3_online.py -index 71dd935..d173f27 100644 ---- a/Tests/test_BioSQL_sqlite3_online.py -+++ b/Tests/test_BioSQL_sqlite3_online.py -@@ -8,6 +8,9 @@ - from common_BioSQL import temp_db_filename - from common_BioSQL_online import * - -+import requires_internet -+requires_internet.check() -+ - # Constants for the database driver - DBDRIVER = 'sqlite3' - DBTYPE = 'sqlite' - diff --git a/python-biopython.spec b/python-biopython.spec index 1296d00..7c44747 100644 --- a/python-biopython.spec +++ b/python-biopython.spec @@ -19,27 +19,26 @@ %global module biopython Name: python-biopython -Version: 1.67 -Release: 3%{?dist} +Version: 1.68 +Release: 1%{?dist} Summary: Python tools for computational molecular biology -Source0: https://github.com/biopython/biopython/archive/biopython-167.tar.gz#/biopython-biopython-167.tar.gz +Source0: http://biopython.org/DIST/biopython-%{version}.tar.gz License: MIT URL: http://www.biopython.org/ Group: Development/Libraries -# Split online tests for BioSQL -Patch0: python-%{module}-split_online_test.patch - BuildRequires: python2-devel BuildRequires: flex-devel BuildRequires: python-reportlab BuildRequires: numpy BuildRequires: python-psycopg2 +BuildRequires: python-rdflib BuildRequires: wise2 Requires: python-reportlab Requires: numpy Requires: python-psycopg2 Requires: wise2 +Requires: python-rdflib %if 0%{?fedora} BuildRequires: python-mysql @@ -73,11 +72,13 @@ BuildRequires: python3-reportlab BuildRequires: python3-numpy BuildRequires: python3-mysql BuildRequires: python3-psycopg2 +BuildRequires: python3-rdflib Requires: python3-reportlab Requires: python3-numpy Requires: python3-mysql Requires: python3-psycopg2 Requires: wise2 +Requires: python3-rdflib %description -n python3-%{module} A set of freely available Python3 tools for computational molecular @@ -93,11 +94,9 @@ PDF/HTML documentation of %{module}. %prep %setup -qc -mv %{module}-%{module}-167 python2 +mv %{module}-%{version} python2 pushd python2 -%patch0 -p1 - # remove all execute bits from documentation and fix line endings find Scripts -type f -exec chmod -x {} 2>/dev/null ';' find Doc -type f -exec chmod -x {} 2>/dev/null ';' @@ -147,12 +146,11 @@ for test in `ls test_*.py | grep -v Tutorial`; do done popd -##Not all tests are executable for Python-3.5 -# https://github.com/biopython/biopython/issues/855 +# See https://github.com/biopython/biopython/issues/855 %if 0%{?with_python3} pushd python3/Tests find . -name 'run_tests.py' | xargs sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' -for test in `ls test_*.py | grep -v test_Tutorial | grep -v test_SeqIO | grep -v test_NCBIXML | grep -v test_Phylo`; do +for test in `ls test_*.py | grep -v test_Tutorial | grep -v test_NCBIXML | grep -v test_Phylo | grep -v test_SeqIO`; do echo $LANG %{__python3} run_tests.py --offline -v ${test} done @@ -186,6 +184,10 @@ popd %license python2/LICENSE %changelog +* Sat Aug 27 2016 Antonio Trande - 1.68-1 +- Update to 1.68 +- Drop old patch + * Wed Aug 17 2016 Antonio Trande - 1.67-3 - Rebuild for Python 3.5.2 diff --git a/sources b/sources index 39de56e..c46a3ba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a74ca7412d2586ab0073a1580f968105 biopython-biopython-167.tar.gz +078e915185485a5327937029b7577ddc biopython-1.68.tar.gz