summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2022-05-15 20:20:08 -0400
committerLeo Famulari <leo@famulari.name>2022-05-15 20:22:02 -0400
commit40a729a0e6f1d660b942241416c1e2c567616d4d (patch)
treef9ba0c1bb87a1c8ef8ba6edb91f32bdf844207a8
parentebb43029506d994bee0c2b890881fd61a0b0c202 (diff)
downloadguix-40a729a0e6f1d660b942241416c1e2c567616d4d.tar.gz
gnu: Fix the build of wicd.
Fixes <https://issues.guix.gnu.org/55440>.

* gnu/packages/check.scm (python2-pytest-cov, python2-freezegun): Define
without package-with-python2.
* gnu/packages/python-xyz.scm (python2-babel): Likewise.
* gnu/packages/time.scm (python2-dateutil): Likwise.
-rw-r--r--gnu/packages/check.scm62
-rw-r--r--gnu/packages/python-xyz.scm32
-rw-r--r--gnu/packages/time.scm39
3 files changed, 130 insertions, 3 deletions
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 8e6576208c..8c161a4a4f 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -1178,6 +1178,38 @@ distributed testing in both @code{load} and @code{each} modes.  It also
 supports coverage of subprocesses.")
   (license license:expat)))
 
+(define-public python2-pytest-cov
+  (package
+    (name "python2-pytest-cov")
+    (version "2.8.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "pytest-cov" version))
+        (sha256
+         (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+          (lambda _
+            ;; Options taken from tox.ini.
+            ;; TODO: make "--restructuredtext" tests pass. They currently fail
+            ;; with "Duplicate implicit target name".
+            (invoke "python" "./setup.py" "check"
+                    "--strict" "--metadata"))))))
+    (propagated-inputs
+     (list python2-coverage python2-pytest))
+    (home-page "https://github.com/pytest-dev/pytest-cov")
+    (synopsis "Pytest plugin for measuring coverage")
+    (description
+     "Pytest-cov produces coverage reports.  It supports centralised testing and
+distributed testing in both @code{load} and @code{each} modes.  It also
+supports coverage of subprocesses.")
+  (license license:expat)))
+
 (define-public python-pytest-httpserver
   (package
     (name "python-pytest-httpserver")
@@ -2935,7 +2967,35 @@ time by mocking the datetime module.")
     (license license:asl2.0)))
 
 (define-public python2-freezegun
-  (package-with-python2 python-freezegun))
+  (package
+    (name "python2-freezegun")
+    (version "0.3.14")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "freezegun" version))
+       (sha256
+        (base32 "0al75mk829j1izxi760b7yjnknjihyfhp2mvi5qiyrxb9cpxwqk2"))))
+    (build-system python-build-system)
+    (native-inputs
+     (list python2-mock python2-pytest))
+    (propagated-inputs
+     (list python2-six python2-dateutil))
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         ;; The tests are normally executed via `make test`, but the PyPi
+         ;; package does not include the Makefile.
+         (replace 'check
+           (lambda _
+             (invoke "pytest" "-vv"))))))
+    (home-page "https://github.com/spulec/freezegun")
+    (synopsis "Test utility for mocking the datetime module")
+    (description
+     "FreezeGun is a library that allows your python tests to travel through
+time by mocking the datetime module.")
+    (license license:asl2.0)))
 
 (define-public python-flexmock
   (package
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 020f078dee..199fcf5fb8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1283,7 +1283,37 @@ etc.")
     (license license:bsd-3)))
 
 (define-public python2-babel
-  (package-with-python2 python-babel))
+  (package
+    (name "python2-babel")
+    (version "2.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "Babel" version))
+       (sha256
+        (base32
+         "018yg7g2pa6vjixx1nx41cfispgfi0azzp0a1chlycbj8jsil0ys"))))
+    (build-system python-build-system)
+    (native-inputs
+     (list python2-freezegun python2-pytest tzdata-for-tests))
+    (propagated-inputs
+     (list python2-pytz))
+    (arguments
+     `(#:python ,python-2
+       #:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      (invoke "pytest" "-vv"))))))
+    (home-page "https://babel.pocoo.org/")
+    (synopsis
+     "Tools for internationalizing Python applications")
+    (description
+     "Babel is composed of two major parts:
+- tools to build and work with gettext message catalogs
+- a Python interface to the CLDR (Common Locale Data Repository), providing
+access to various locale display names, localized number and date formatting,
+etc.")
+    (license license:bsd-3)))
 
 (define-public python2-backport-ssl-match-hostname
   (package
diff --git a/gnu/packages/time.scm b/gnu/packages/time.scm
index 9b57fe41fb..ca5e462680 100644
--- a/gnu/packages/time.scm
+++ b/gnu/packages/time.scm
@@ -233,7 +233,44 @@ datetime module, available in Python 2.3+.")
     (license (list bsd-3 asl2.0))))
 
 (define-public python2-dateutil
-  (package-with-python2 python-dateutil))
+  (package
+    (name "python2-dateutil")
+    (version "2.8.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-dateutil" version))
+       (sha256
+        (base32
+         "11iy7m4bp2lgfkcl0r6xzf34bvk7ppjmsyn2ygfikbi72v6cl8q1"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda _
+                      ;; Delete tests that depend on "freezegun" to avoid a
+                      ;; circular dependency.
+                      (delete-file "dateutil/test/test_utils.py")
+                      (delete-file "dateutil/test/test_rrule.py")
+
+                      ;; XXX: Fails to get timezone from /etc/localtime.
+                      (delete-file "dateutil/test/test_tz.py")
+
+                      (invoke "pytest" "-vv"))))))
+    (native-inputs
+     (list python2-pytest python2-pytest-cov python2-setuptools-scm))
+    (propagated-inputs
+     (list python2-six))
+    (home-page "https://dateutil.readthedocs.io/en/stable/")
+    (synopsis "Extensions to the standard datetime module")
+    (description
+     "The dateutil module provides powerful extensions to the standard
+datetime module, available in Python 2.3+.")
+    ;; The license was changed from the three-clause BSD license to a dual
+    ;; Apache 2.0/BSD-3 variant at 2017-12-01.  Some code is only available as
+    ;; BSD-3 still; but all new code is dual licensed (the user can choose).
+    (license (list bsd-3 asl2.0))))
 
 (define-public python-parsedatetime
   (package