From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dcGzz-0000s2-KC for guix-patches@gnu.org; Mon, 31 Jul 2017 16:09:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dcGzv-0002OI-GQ for guix-patches@gnu.org; Mon, 31 Jul 2017 16:09:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dcGzv-0002OD-C8 for guix-patches@gnu.org; Mon, 31 Jul 2017 16:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dcGzv-0004sM-70 for guix-patches@gnu.org; Mon, 31 Jul 2017 16:09:03 -0400 Subject: [bug#27888] [PATCH 17/18] gnu: python-mock: Make 2.0 the default package. Resent-Message-ID: From: Marius Bakke Date: Mon, 31 Jul 2017 22:07:34 +0200 Message-Id: <20170731200735.28019-17-mbakke@fastmail.com> In-Reply-To: <20170731200735.28019-1-mbakke@fastmail.com> References: <20170731200735.28019-1-mbakke@fastmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27888@debbugs.gnu.org * 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