aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-02-27 22:19:31 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-02-28 13:59:00 +0100
commitb39667cdcb2cbcf98d9fa94101c47731ca7b6394 (patch)
tree4b1bec58b7b17d926ae66f744dedcc86b134ffef
parent7a565dc9ec7c2b904cf3a82975b947cd736d0b3a (diff)
downloadpatches-b39667cdcb2cbcf98d9fa94101c47731ca7b6394.tar
patches-b39667cdcb2cbcf98d9fa94101c47731ca7b6394.tar.gz
gnu: python-mox3: Update to 0.24.0.
* gnu/packages/openstack.scm (python-mox3): Update to 0.24.0. [source](patches): New field. [arguments]: Remove. [native-inputs]: Add PYTHON-OPENSTACKDOCSTHEME and PYTHON-SUBUNIT. Replace PYTHON-SPHINX with PYTHON-SPHINX-1.6. Move PYTHON-PBR and PYTHON-FIXTURES ... [propagated-inputs]: ... here. New field. [description]: Don't mention explicit Python versions. * gnu/packages/patches/python-mox3-python3.6-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/openstack.scm23
-rw-r--r--gnu/packages/patches/python-mox3-python3.6-compat.patch43
3 files changed, 56 insertions, 11 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 68f3a20f6d..24368727f2 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1036,6 +1036,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-scikit-learn-fix-test-non-determinism.patch \
%D%/packages/patches/python-configobj-setuptools.patch \
%D%/packages/patches/python-faker-fix-build-32bit.patch \
+ %D%/packages/patches/python-mox3-python3.6-compat.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/openstack.scm b/gnu/packages/openstack.scm
index 0d1d69945e..be1927dbe8 100644
--- a/gnu/packages/openstack.scm
+++ b/gnu/packages/openstack.scm
@@ -21,6 +21,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages openstack)
+ #:use-module (gnu packages)
#:use-module (gnu packages check)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages python)
@@ -156,31 +157,31 @@ guidelines}.")
(define-public python-mox3
(package
(name "python-mox3")
- (version "0.14.0")
+ (version "0.24.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "mox3" version))
+ (patches (search-patches "python-mox3-python3.6-compat.patch"))
(sha256
(base32
- "0njmh40i1lg5mzn9hc2ax83adj6dli455j6xifilrw27c4wlkjzx"))))
+ "0w58adwv7q9wzvmq9mlrk2asfk73myq9fpwy7mjkzsz3baa95zf5"))))
(build-system python-build-system)
- (arguments
- ;; TODO: Resolve dependency cycle and re-enable.
- '(#:tests? #f))
+ (propagated-inputs
+ `(("python-fixtures" ,python-fixtures)
+ ("python-pbr" ,python-pbr)))
(native-inputs
- `(("python-fixtures" ,python-fixtures)
- ; TODO re-add ("python-oslosphinx" ,python-oslosphinx)
- ("python-pbr" ,python-pbr)
- ("python-sphinx" ,python-sphinx)
+ `(("python-openstackdocstheme" ,python-openstackdocstheme)
+ ("python-sphinx" ,python-sphinx-1.6)
+ ("python-subunit" ,python-subunit)
+ ("python-testrepository" ,python-testrepository)
("python-testtools" ,python-testtools)))
(home-page "https://www.openstack.org/")
(synopsis "Mock object framework for Python")
(description
"Mox3 is an unofficial port of the @uref{https://code.google.com/p/pymox/,
Google mox framework} to Python 3. It was meant to be as compatible
-with mox as possible, but small enhancements have been made. The library was
-tested on Python versions 3.2, 2.7, and 2.6.")
+with mox as possible, but small enhancements have been made.")
(license asl2.0)))
(define-public python2-mox3
diff --git a/gnu/packages/patches/python-mox3-python3.6-compat.patch b/gnu/packages/patches/python-mox3-python3.6-compat.patch
new file mode 100644
index 0000000000..0426d07cf9
--- /dev/null
+++ b/gnu/packages/patches/python-mox3-python3.6-compat.patch
@@ -0,0 +1,43 @@
+Fix regex so that it works with Python 3.6.
+
+See <https://docs.python.org/3/library/re.html#re.LOCALE>.
+
+Copied from upstream bug report:
+https://bugs.launchpad.net/python-mox3/+bug/1665266
+
+From 05064cdb6ea7a16450c6beae2b6f7c6074212a69 Mon Sep 17 00:00:00 2001
+From: Zac Medico <zmedico@gentoo.org>
+Date: Thu, 16 Feb 2017 00:24:10 -0800
+Subject: [PATCH] RegexTest: python3.6 compatibility
+
+These fixes are backward-compatible with older python versions:
+
+* raw strings fix invalid escape sequences
+* flags=8 fixes ValueError: cannot use LOCALE flag with a str pattern
+---
+ mox3/tests/test_mox.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/mox3/tests/test_mox.py b/mox3/tests/test_mox.py
+index 15ac565..3a1af17 100644
+--- a/mox3/tests/test_mox.py
++++ b/mox3/tests/test_mox.py
+@@ -312,12 +312,12 @@ class RegexTest(testtools.TestCase):
+ def testReprWithoutFlags(self):
+ """repr should return the regular expression pattern."""
+ self.assertTrue(
+- repr(mox.Regex(r"a\s+b")) == "<regular expression 'a\s+b'>")
++ repr(mox.Regex(r"a\s+b")) == r"<regular expression 'a\s+b'>")
+
+ def testReprWithFlags(self):
+ """repr should return the regular expression pattern and flags."""
+- self.assertTrue(repr(mox.Regex(r"a\s+b", flags=4)) ==
+- "<regular expression 'a\s+b', flags=4>")
++ self.assertTrue(repr(mox.Regex(r"a\s+b", flags=8)) ==
++ r"<regular expression 'a\s+b', flags=8>")
+
+
+ class IsTest(testtools.TestCase):
+--
+2.10.2
+