all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: 27888@debbugs.gnu.org
Subject: [bug#27888] [PATCH 15/18] gnu: python-unittest2: Update to 1.1.0.
Date: Mon, 31 Jul 2017 22:07:32 +0200	[thread overview]
Message-ID: <20170731200735.28019-15-mbakke@fastmail.com> (raw)
In-Reply-To: <20170731200735.28019-1-mbakke@fastmail.com>

* gnu/packages/python.scm (python-unittest2): Update to 1.1.0.
[source]: Use PYPI-URI. Add python3 compatibility patch.
[arguments]: Add phases to loosen dependency requirements and run tests.
[propagated-inputs]: Add PYTHON-SIX and PYTHON-TRACEBACK2.
(python2-unittest2): Use 'package-with-python2'.
* gnu/packages/patches/python-unittest2-python3-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                       |  1 +
 .../patches/python-unittest2-python3-compat.patch  | 34 ++++++++++++++++++
 gnu/packages/python.scm                            | 42 +++++++++++-----------
 3 files changed, 57 insertions(+), 20 deletions(-)
 create mode 100644 gnu/packages/patches/python-unittest2-python3-compat.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 62ef61589..ce3d821d9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -957,6 +957,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
   %D%/packages/patches/python2-subprocess32-disable-input-test.patch	\
+  %D%/packages/patches/python-unittest2-python3-compat.patch	\
   %D%/packages/patches/qemu-CVE-2017-7493.patch			\
   %D%/packages/patches/qemu-CVE-2017-8112.patch			\
   %D%/packages/patches/qemu-CVE-2017-8309.patch			\
diff --git a/gnu/packages/patches/python-unittest2-python3-compat.patch b/gnu/packages/patches/python-unittest2-python3-compat.patch
new file mode 100644
index 000000000..fe0afe559
--- /dev/null
+++ b/gnu/packages/patches/python-unittest2-python3-compat.patch
@@ -0,0 +1,34 @@
+Skip tests that fail with newer versions of Python.
+
+Patch copied from Gentoo:
+
+https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/unittest2/files/unittest2-1.1.0-python3.5-test.patch
+
+diff --git a/unittest2/test/test_loader.py b/unittest2/test/test_loader.py
+index 683f662..347eea5 100644
+--- a/unittest2/test/test_loader.py
++++ b/unittest2/test/test_loader.py
+@@ -509,6 +509,7 @@ class Test_TestLoader(unittest2.TestCase):
+     #
+     # What happens when an impossible name is given, relative to the provided
+     # `module`?
++    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
+     def test_loadTestsFromName__relative_malformed_name(self):
+         loader = unittest.TestLoader()
+ 
+@@ -811,6 +812,7 @@ class Test_TestLoader(unittest2.TestCase):
+     # TestCase or TestSuite instance."
+     #
+     # What happens when presented with an impossible module name?
++    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
+     def test_loadTestsFromNames__malformed_name(self):
+         loader = unittest2.TestLoader()
+ 
+@@ -918,6 +920,7 @@ class Test_TestLoader(unittest2.TestCase):
+     # "The method optionally resolves name relative to the given module"
+     #
+     # What happens when presented with an impossible attribute name?
++    @unittest.skipIf(sys.version_info[:2] >= (3, 5), "python 3.5 has problems here")
+     def test_loadTestsFromNames__relative_malformed_name(self):
+         loader = unittest.TestLoader()
+ 
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 77efcf1ed..3217de524 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1871,17 +1871,33 @@ interfaces and processes.")
 (define-public python-unittest2
   (package
     (name "python-unittest2")
-    (version "0.5.1")
+    (version "1.1.0")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/u/unittest2py3k/unittest2py3k-"
-             version ".tar.gz"))
+       (uri (pypi-uri "unittest2" version))
+       (patches
+        (search-patches "python-unittest2-python3-compat.patch"))
        (sha256
         (base32
-         "00yl6lskygcrddx5zspkhr0ibgvpknl4678kkm6s626539grq93q"))))
+         "0y855kmx7a8rnf81d3lh5lyxai1908xjp0laf4glwa4c8472m212"))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'adjust-dependencies
+           (lambda _
+             ;; Don't check for separate argparse module when it's shipped
+             ;; in all Python versions we support (2.7+).
+             (substitute* "setup.py"
+               (("'argparse',") ""))
+             #t))
+         (replace 'check
+           (lambda _
+             (zero? (system* "python" "-m" "unittest2" "discover" "--verbose")))))))
+    (propagated-inputs
+     `(("python-six" ,python-six)
+       ("python-traceback2" ,python-traceback2)))
     (home-page "http://pypi.python.org/pypi/unittest2")
     (synopsis "Python unit testing library")
     (description
@@ -1890,21 +1906,7 @@ standard library.")
     (license license:psfl)))
 
 (define-public python2-unittest2
-  (package (inherit python-unittest2)
-    (name "python2-unittest2")
-    (version "0.5.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://pypi.python.org/packages/source/u/unittest2/unittest2-"
-             version ".tar.gz"))
-       (sha256
-        (base32
-         "0wbs4i4x3x7klr3v35ss6p9mcqz883i1xgcpkhvl7n2lyv6yhpda"))))
-    (arguments
-     `(#:python ,python-2
-       #:tests? #f)))) ; no setup.py test command
+  (package-with-python2 python-unittest2))
 
 (define-public python-pafy
   (package
-- 
2.13.3

  parent reply	other threads:[~2017-07-31 20:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <handler.27888.B.150153147718000.ack@debbugs.gnu.org>
2017-07-31 20:07 ` [bug#27888] [PATCH 01/18] gnu: python@3: Update to 3.6.2 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 02/18] gnu: python-py: Update to 1.4.34 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 03/18] gnu: python-six: Really enable tests Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 04/18] gnu: Remove python-pytest@2 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 05/18] gnu: python-pytest: Add a minimal variant for bootstrapping Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 06/18] gnu: python-setuptools-scm: Update to 1.15.6 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 07/18] gnu: python-pytest: Update to 3.1.3 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 08/18] gnu: python-pyflakes: Update to 1.5.0 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 09/18] gnu: python-mccabe: Update to 0.6.1 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 10/18] gnu: python-mock@2: Add dependency on python-six Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 11/18] gnu: Add python2-enum Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 12/18] gnu: python-flake8: Update to 3.4.1 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 13/18] gnu: Add python-linecache2 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 14/18] gnu: Add python-traceback2 Marius Bakke
2017-07-31 20:07   ` Marius Bakke [this message]
2017-07-31 20:07   ` [bug#27888] [PATCH 16/18] gnu: Add python2-funcsigs Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 17/18] gnu: python-mock: Make 2.0 the default package Marius Bakke
2017-07-31 20:45     ` Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 18/18] gnu: python-hypothesis: Update to 3.14.0 Marius Bakke
2017-07-31 23:07   ` [bug#27888] [PATCH 01/18] gnu: python@3: Update to 3.6.2 Leo Famulari
2017-08-01  0:30     ` Marius Bakke
2017-10-18 21:17       ` Ricardo Wurmus
2017-10-18 22:30         ` bug#27888: " Marius Bakke
2017-10-18 23:36           ` [bug#27888] " Cyril Roelandt
2017-10-19 18:15             ` Marius Bakke
2017-10-19  7:58           ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170731200735.28019-15-mbakke@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=27888@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.