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 17/18] gnu: python-mock: Make 2.0 the default package.
Date: Mon, 31 Jul 2017 22:07:34 +0200	[thread overview]
Message-ID: <20170731200735.28019-17-mbakke@fastmail.com> (raw)
In-Reply-To: <20170731200735.28019-1-mbakke@fastmail.com>

* gnu/packages/python.scm (python-mock): Update to 2.0.0.
[native-inputs]: Add PYTHON-UNITTEST2.
[propagated-inputs]: Add PYTHON-PBR and PYTHON-SIX.
[arguments]: Override 'check' phase.
[properties]: Declare python2 variant.
(python2-mock)[propagated-inputs]: Add PYTHON2-FUNCTOOLS32 and PYTHON2-FUNCSIGS.
(python-mock-2): Remove variable.
* gnu/packages/python.scm (python-flake8)[native-inputs]: Adjust accordingly.
* gnu/packages/tls.scm (python-acme, certbot)[native-inputs]: Likewise.
---
 gnu/packages/python.scm | 47 ++++++++++++++++++++++-------------------------
 gnu/packages/tls.scm    |  4 ++--
 2 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index e1bc3905a..9a7f88c30 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -932,46 +932,43 @@ API for locking files.")
 (define-public python-mock
   (package
     (name "python-mock")
-    (version "1.0.1")
+    (version "2.0.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "mock" version))
        (sha256
         (base32
-         "0kzlsbki6q0awf89rc287f3aj8x431lrajf160a70z0ikhnxsfdq"))))
+         "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
+    (propagated-inputs
+     `(("python-pbr" ,python-pbr-minimal)
+       ("python-six" ,python-six)))
     (build-system python-build-system)
-    (arguments '(#:test-target "check"))
+    (native-inputs
+     `(("python-unittest2" ,python-unittest2)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (zero? (system* "unit2")))))))
     (home-page "https://github.com/testing-cabal/mock")
     (synopsis "Python mocking and patching library for testing")
     (description
      "Mock is a library for testing in Python.  It allows you to replace parts
 of your system under test with mock objects and make assertions about how they
 have been used.")
+    (properties `((python2-variant . ,(delay python2-mock))))
     (license license:expat)))
 
 (define-public python2-mock
-  (package-with-python2 python-mock))
-
-;;; Some packages (notably, certbot and python-acme) rely on this newer version
-;;; of python-mock. However, a large number of packages fail to build with
-;;; mock@2, so we add a new variable for now. Also, there may be a dependency
-;;; cycle between mock and six, so we avoid creating python2-mock@2 for now.
-(define-public python-mock-2
-  (package
-    (inherit python-mock)
-    (version "2.0.0")
-    (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "mock" version))
-        (sha256
-         (base32
-          "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i"))))
-    (propagated-inputs
-     `(("python-pbr" ,python-pbr-minimal)
-       ("python-six" ,python-six)
-       ,@(package-propagated-inputs python-mock)))))
+  (let ((base (package-with-python2
+               (strip-python2-variant python-mock))))
+    (package (inherit base)
+      (propagated-inputs
+       `(("python2-functools32" ,python2-functools32)
+         ("python2-funcsigs" ,python2-funcsigs)
+         ,@(package-propagated-inputs base))))))
 
 (define-public python-setuptools
   (package
@@ -6927,7 +6924,7 @@ complexity of Python source code.")
         ("python-setuptools" ,python-setuptools)
         ("python-mccabe" ,python-mccabe)))
     (native-inputs
-      `(("python-mock" ,python-mock-2) ; TODO: only required for < 3.3
+      `(("python-mock" ,python-mock) ; TODO: only required for < 3.3
         ("python-pytest" ,python-pytest-bootstrap)
         ("python-pytest-runner" ,python-pytest-runner)))
     (home-page "https://gitlab.com/pycqa/flake8")
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 5a94ac619..4c64a0b0a 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -502,7 +502,7 @@ netcat implementation that supports TLS.")
                #t))))))
     ;; TODO: Add optional inputs for testing.
     (native-inputs
-     `(("python-mock" ,python-mock-2)
+     `(("python-mock" ,python-mock)
        ;; For documentation
        ("python-sphinx" ,python-sphinx)
        ("python-sphinxcontrib-programoutput" ,python-sphinxcontrib-programoutput)
@@ -554,7 +554,7 @@ netcat implementation that supports TLS.")
     ;; TODO: Add optional inputs for testing.
     (native-inputs
      `(("python-nose" ,python-nose)
-       ("python-mock" ,python-mock-2)
+       ("python-mock" ,python-mock)
        ;; For documentation
        ("python-sphinx" ,python-sphinx)
        ("python-sphinx-rtd-theme" ,python-sphinx-rtd-theme)
-- 
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   ` [bug#27888] [PATCH 15/18] gnu: python-unittest2: Update to 1.1.0 Marius Bakke
2017-07-31 20:07   ` [bug#27888] [PATCH 16/18] gnu: Add python2-funcsigs Marius Bakke
2017-07-31 20:07   ` Marius Bakke [this message]
2017-07-31 20:45     ` [bug#27888] [PATCH 17/18] gnu: python-mock: Make 2.0 the default package 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-17-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.