From 7c6bf660d8a455090f4c140c5b2849f1b58f2fe3 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 16 Dec 2016 14:32:34 +0100 Subject: gnu: python-pyopenssl: Enable tests. * gnu/packages/patches/python-pyopenssl-skip-network-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python.scm (python-pyopenssl, python2-pyopenssl)[source]: Use it. [arguments]: Replace 'check' with custom phase. --- .../python-pyopenssl-skip-network-test.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 gnu/packages/patches/python-pyopenssl-skip-network-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/python-pyopenssl-skip-network-test.patch b/gnu/packages/patches/python-pyopenssl-skip-network-test.patch new file mode 100644 index 0000000000..a24eaf69a0 --- /dev/null +++ b/gnu/packages/patches/python-pyopenssl-skip-network-test.patch @@ -0,0 +1,50 @@ +This test tries connecting to an external server which is not supported +in the build environment. See discussion at: + +https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00650.html + +diff --git a/tests/test_ssl.py b/tests/test_ssl.py +index ee849fd..60048b8 100644 +--- a/tests/test_ssl.py ++++ b/tests/test_ssl.py +@@ -1180,40 +1180,6 @@ class ContextTests(TestCase, _LoopbackMixin): + TypeError, context.load_verify_locations, None, None, None + ) + +- @pytest.mark.skipif( +- platform == "win32", +- reason="set_default_verify_paths appears not to work on Windows. " +- "See LP#404343 and LP#404344." +- ) +- def test_set_default_verify_paths(self): +- """ +- :py:obj:`Context.set_default_verify_paths` causes the +- platform-specific CA certificate locations to be used for +- verification purposes. +- """ +- # Testing this requires a server with a certificate signed by one +- # of the CAs in the platform CA location. Getting one of those +- # costs money. Fortunately (or unfortunately, depending on your +- # perspective), it's easy to think of a public server on the +- # internet which has such a certificate. Connecting to the network +- # in a unit test is bad, but it's the only way I can think of to +- # really test this. -exarkun +- +- # Arg, verisign.com doesn't speak anything newer than TLS 1.0 +- context = Context(SSLv23_METHOD) +- context.set_default_verify_paths() +- context.set_verify( +- VERIFY_PEER, +- lambda conn, cert, errno, depth, preverify_ok: preverify_ok) +- +- client = socket() +- client.connect(("encrypted.google.com", 443)) +- clientSSL = Connection(context, client) +- clientSSL.set_connect_state() +- clientSSL.do_handshake() +- clientSSL.send(b"GET / HTTP/1.0\r\n\r\n") +- self.assertTrue(clientSSL.recv(1024)) +- + def test_set_default_verify_paths_signature(self): + """ + :py:obj:`Context.set_default_verify_paths` takes no arguments and -- cgit v1.2.3 From bb6043fe9f0198c1e253ae2a8adeea1337830265 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Tue, 14 Feb 2017 00:01:59 +0100 Subject: gnu: python-pygit2: Skip tests requiring network access. * gnu/packages/python.scm (python-pygit2, python2-pygit2)[source](patches): New field. * gnu/packages/patches/python-pygit2-disable-network-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + .../python-pygit2-disable-network-tests.patch | 64 ++++++++++++++++++++++ gnu/packages/python.scm | 4 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-pygit2-disable-network-tests.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8615d12b08..0b9b5b1a1e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -861,6 +861,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-configobj-setuptools.patch \ %D%/packages/patches/python-paste-remove-website-test.patch \ %D%/packages/patches/python-paste-remove-timing-test.patch \ + %D%/packages/patches/python-pygit2-disable-network-tests.patch \ %D%/packages/patches/python-pyopenssl-skip-network-test.patch \ %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch \ %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \ diff --git a/gnu/packages/patches/python-pygit2-disable-network-tests.patch b/gnu/packages/patches/python-pygit2-disable-network-tests.patch new file mode 100644 index 0000000000..e46d244807 --- /dev/null +++ b/gnu/packages/patches/python-pygit2-disable-network-tests.patch @@ -0,0 +1,64 @@ +Disable tests trying to look up remote servers. + +diff --git a/test/test_credentials.py b/test/test_credentials.py +index 92482d9..9a281e5 100644 +--- a/test/test_credentials.py ++++ b/test/test_credentials.py +@@ -68,39 +68,5 @@ class CredentialCreateTest(utils.NoRepoTestCase): + self.assertEqual((username, None, None, None), cred.credential_tuple) + + +-class CredentialCallback(utils.RepoTestCase): +- def test_callback(self): +- class MyCallbacks(pygit2.RemoteCallbacks): +- @staticmethod +- def credentials(url, username, allowed): +- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) +- raise Exception("I don't know the password") +- +- url = "https://github.com/github/github" +- remote = self.repo.create_remote("github", url) +- +- self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) +- +- def test_bad_cred_type(self): +- class MyCallbacks(pygit2.RemoteCallbacks): +- @staticmethod +- def credentials(url, username, allowed): +- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) +- return Keypair("git", "foo.pub", "foo", "sekkrit") +- +- url = "https://github.com/github/github" +- remote = self.repo.create_remote("github", url) +- self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks())) +- +-class CallableCredentialTest(utils.RepoTestCase): +- +- def test_user_pass(self): +- credentials = UserPass("libgit2", "libgit2") +- callbacks = pygit2.RemoteCallbacks(credentials=credentials) +- +- url = "https://bitbucket.org/libgit2/testgitrepository.git" +- remote = self.repo.create_remote("bb", url) +- remote.fetch(callbacks=callbacks) +- + if __name__ == '__main__': + unittest.main() +diff --git a/test/test_repository.py b/test/test_repository.py +index cfdf01e..c0d8de4 100644 +--- a/test/test_repository.py ++++ b/test/test_repository.py +@@ -538,13 +538,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): + self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) + self.assertIsNotNone(repo.remotes["custom_remote"]) + +- def test_clone_with_credentials(self): +- repo = clone_repository( +- "https://bitbucket.org/libgit2/testgitrepository.git", +- self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) +- +- self.assertFalse(repo.is_empty) +- + def test_clone_with_checkout_branch(self): + # create a test case which isolates the remote + test_repo = clone_repository('./test/data/testrepo.git', diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 13dc698341..c9cf347373 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3580,7 +3580,9 @@ (define-public python-pygit2 (uri (pypi-uri "pygit2" version)) (sha256 (base32 - "0wf5rp0fvrw7j3j18dvwjq6xqlbm611wd55aphrfpps0v1gxh3ny")))) + "0wf5rp0fvrw7j3j18dvwjq6xqlbm611wd55aphrfpps0v1gxh3ny")) + (patches + (search-patches "python-pygit2-disable-network-tests.patch")))) (build-system python-build-system) (propagated-inputs `(("python-six" ,python-six) -- cgit v1.2.3 From a1e3ed6e8b57c1920d01e357fb2a8e545d4acc33 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 18 Feb 2017 16:43:37 +0100 Subject: gnu: python-pbr: Support python-sphinx>=1.2.1. * gnu/packages/patches/python-pbr-fix-man-page-support.patch: New file. * gnu/packages/python.scm (python-pbr-minimal): Use the new patch file. --- .../patches/python-pbr-fix-man-page-support.patch | 28 ++++++++++++++++++++++ gnu/packages/python.scm | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-pbr-fix-man-page-support.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/python-pbr-fix-man-page-support.patch b/gnu/packages/patches/python-pbr-fix-man-page-support.patch new file mode 100644 index 0000000000..b9036f5b01 --- /dev/null +++ b/gnu/packages/patches/python-pbr-fix-man-page-support.patch @@ -0,0 +1,28 @@ +See: https://bugs.launchpad.net/oslosphinx/+bug/1661861 +diff -ur orig/pbr-1.10.0/pbr/builddoc.py pbr-1.10.0/pbr/builddoc.py +--- orig/pbr-1.10.0/pbr/builddoc.py 2016-05-23 21:38:18.000000000 +0200 ++++ pbr-1.10.0/pbr/builddoc.py 2017-02-18 14:01:37.424434317 +0100 +@@ -138,7 +138,8 @@ + sphinx_config.init_values(warnings.warn) + else: + sphinx_config.init_values() +- if self.builder == 'man' and len(sphinx_config.man_pages) == 0: ++ if self.builder == 'man' and len( ++ getattr(sphinx_config, 'man_pages', '')) == 0: + return + app = application.Sphinx( + self.source_dir, self.config_dir, +diff -ur orig/pbr-1.10.0/pbr/util.py pbr-1.10.0/pbr/util.py +--- orig/pbr-1.10.0/pbr/util.py 2016-05-23 21:38:18.000000000 +0200 ++++ pbr-1.10.0/pbr/util.py 2017-02-18 15:36:32.951196795 +0100 +@@ -211,7 +211,9 @@ + parser.read(path) + config = {} + for section in parser.sections(): +- config[section] = dict(parser.items(section)) ++ config[section] = dict() ++ for k, value in parser.items(section): ++ config[section][k.replace('-', '_')] = value + + # Run setup_hooks, if configured + setup_hooks = has_get_option(config, 'global', 'setup_hooks') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5bcdc6d0c7..93e18b2fb9 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2130,7 +2130,8 @@ (define python-pbr-minimal (uri (pypi-uri "pbr" version)) (sha256 (base32 - "177kd9kbv1hvf2ban7l3x9ymzbi1md4hkaymwbgnz7ihf312hr0q")))) + "177kd9kbv1hvf2ban7l3x9ymzbi1md4hkaymwbgnz7ihf312hr0q")) + (patches (search-patches "python-pbr-fix-man-page-support.patch")))) (build-system python-build-system) (arguments `(#:tests? #f)) -- cgit v1.2.3 From 42945fb58c4652943a036c99f9bcc59fab61909b Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 24 Feb 2017 18:24:06 +0100 Subject: gnu: python-fake-factory: Fix build on 32bit. * gnu/packages/patches/python-fake-factory-fix-build-32bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/python.scm (python-fake-factory, python2-fake-factory)[source]: Use it. --- gnu/local.mk | 1 + .../python-fake-factory-fix-build-32bit.patch | 36 ++++++++++++++++++++++ gnu/packages/python.scm | 5 ++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-fake-factory-fix-build-32bit.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 0b9b5b1a1e..63eb56cc51 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -859,6 +859,7 @@ dist_patch_DATA = \ %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ %D%/packages/patches/python-statsmodels-fix-tests.patch \ %D%/packages/patches/python-configobj-setuptools.patch \ + %D%/packages/patches/python-fake-factory-fix-build-32bit.patch \ %D%/packages/patches/python-paste-remove-website-test.patch \ %D%/packages/patches/python-paste-remove-timing-test.patch \ %D%/packages/patches/python-pygit2-disable-network-tests.patch \ diff --git a/gnu/packages/patches/python-fake-factory-fix-build-32bit.patch b/gnu/packages/patches/python-fake-factory-fix-build-32bit.patch new file mode 100644 index 0000000000..cb60896fad --- /dev/null +++ b/gnu/packages/patches/python-fake-factory-fix-build-32bit.patch @@ -0,0 +1,36 @@ +These tests fail on 32-bit due to an overflow. + +Upstream bug URL: https://github.com/joke2k/faker/issues/408 + +diff --git a/faker/tests/__init__.py b/faker/tests/__init__.py +index 6026772..58b6b83 100644 +--- a/faker/tests/__init__.py ++++ b/faker/tests/__init__.py +@@ -384,7 +384,6 @@ class FactoryTestCase(unittest.TestCase): + provider = Provider + # test century + self.assertTrue(self._datetime_to_time(provider.date_time_this_century(after_now=False)) <= self._datetime_to_time(datetime.datetime.now())) +- self.assertTrue(self._datetime_to_time(provider.date_time_this_century(before_now=False, after_now=True)) >= self._datetime_to_time(datetime.datetime.now())) + # test decade + self.assertTrue(self._datetime_to_time(provider.date_time_this_decade(after_now=False)) <= self._datetime_to_time(datetime.datetime.now())) + self.assertTrue(self._datetime_to_time(provider.date_time_this_decade(before_now=False, after_now=True)) >= self._datetime_to_time(datetime.datetime.now())) +@@ -413,8 +412,6 @@ class FactoryTestCase(unittest.TestCase): + + # ensure all methods provide timezone aware datetimes + with self.assertRaises(TypeError): +- provider.date_time_this_century(before_now=False, after_now=True, tzinfo=utc) >= datetime.datetime.now() +- with self.assertRaises(TypeError): + provider.date_time_this_decade(after_now=False, tzinfo=utc) <= datetime.datetime.now() + with self.assertRaises(TypeError): + provider.date_time_this_year(after_now=False, tzinfo=utc) <= datetime.datetime.now() +@@ -423,7 +420,6 @@ class FactoryTestCase(unittest.TestCase): + + # test century + self.assertTrue(provider.date_time_this_century(after_now=False, tzinfo=utc) <= datetime.datetime.now(utc)) +- self.assertTrue(provider.date_time_this_century(before_now=False, after_now=True, tzinfo=utc) >= datetime.datetime.now(utc)) + # test decade + self.assertTrue(provider.date_time_this_decade(after_now=False, tzinfo=utc) <= datetime.datetime.now(utc)) + self.assertTrue(provider.date_time_this_decade(before_now=False, after_now=True, tzinfo=utc) >= datetime.datetime.now(utc)) +-- +2.11.1 + diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 8353ca178f..e26e442e58 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -11228,7 +11228,10 @@ (define-public python-fake-factory (uri (pypi-uri "fake-factory" version)) (sha256 (base32 - "0vs0dkmg0dlaxf8w6q2i3k0i03gmp56ablldv7ci9x3nbadkn71g")))) + "0vs0dkmg0dlaxf8w6q2i3k0i03gmp56ablldv7ci9x3nbadkn71g")) + (patches + (search-patches + "python-fake-factory-fix-build-32bit.patch")))) (build-system python-build-system) (arguments '(#:phases -- cgit v1.2.3 From 1885bb0c08e943a2e0e37c5c0a83473c8af904d0 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 21 Feb 2017 18:28:21 +0100 Subject: gnu: python-dendropy: Fix failing tests. * gnu/packages/patches/python-dendropy-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/bioinformatics.scm (python-dendropy)[source]: Add patch. --- gnu/local.mk | 1 + gnu/packages/bioinformatics.scm | 3 +- .../patches/python-dendropy-fix-tests.patch | 41 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-dendropy-fix-tests.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 63eb56cc51..899dc06b8e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -853,6 +853,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-3-search-paths.patch \ %D%/packages/patches/python-3.4-fix-tests.patch \ %D%/packages/patches/python-3.5-fix-tests.patch \ + %D%/packages/patches/python-dendropy-fix-tests.patch \ %D%/packages/patches/python-file-double-encoding-bug.patch \ %D%/packages/patches/python-fix-tests.patch \ %D%/packages/patches/python-parse-too-many-fields.patch \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 5a1738b936..de6186de27 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -1981,7 +1981,8 @@ (define-public python-dendropy (uri (pypi-uri "DendroPy" version)) (sha256 (base32 - "15c7s3d5gf19ljsxvq5advaa752wfi7pwrdjyhzmg85hccyvp47p")))) + "15c7s3d5gf19ljsxvq5advaa752wfi7pwrdjyhzmg85hccyvp47p")) + (patches (search-patches "python-dendropy-fix-tests.patch")))) (build-system python-build-system) (home-page "http://packages.python.org/DendroPy/") (synopsis "Library for phylogenetics and phylogenetic computing") diff --git a/gnu/packages/patches/python-dendropy-fix-tests.patch b/gnu/packages/patches/python-dendropy-fix-tests.patch new file mode 100644 index 0000000000..30ab618ff1 --- /dev/null +++ b/gnu/packages/patches/python-dendropy-fix-tests.patch @@ -0,0 +1,41 @@ +This patch fixes two test failures. It was downloaded from: +https://github.com/jeetsukumaran/DendroPy/commit/93f984bba7a6c588a28ca87f4e557ce283809453 + +From 93f984bba7a6c588a28ca87f4e557ce283809453 Mon Sep 17 00:00:00 2001 +From: jeetsukumaran +Date: Tue, 21 Feb 2017 16:41:01 -0500 +Subject: [PATCH] Update to Python 3 container and iteration semantics + +--- + dendropy/dataio/newickreader.py | 3 ++- + dendropy/datamodel/treemodel.py | 3 +++ + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/dendropy/dataio/newickreader.py b/dendropy/dataio/newickreader.py +index 6dcf3c5..f978729 100644 +--- a/dendropy/dataio/newickreader.py ++++ b/dendropy/dataio/newickreader.py +@@ -303,7 +303,8 @@ def tree_iter(self, + taxon_symbol_map_fn=taxon_symbol_mapper.require_taxon_for_symbol) + yield tree + if tree is None: +- raise StopIteration ++ # raise StopIteration ++ return + + def _read(self, + stream, +diff --git a/dendropy/datamodel/treemodel.py b/dendropy/datamodel/treemodel.py +index 0ecfe31..73146f0 100644 +--- a/dendropy/datamodel/treemodel.py ++++ b/dendropy/datamodel/treemodel.py +@@ -772,6 +772,9 @@ def __hash__(self): + def __eq__(self, other): + return self is other + ++ def __lt__(self, other): ++ return id(self) < id(other) ++ + ########################################################################### + ### Basic Structure + -- cgit v1.2.3