From 5475a267ea2668dd2923b578658e10f031e724a1 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 11:00:27 -0400 Subject: gnu: Add python-pytest-mypy. * gnu/packages/check.scm (python-pytest-mypy): New variable. --- gnu/packages/check.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 335ab7ab11..75b42b945a 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2200,6 +2200,27 @@ style test suites, summarizing their results, and providing indication of failures.") (license license:ncsa))) +(define-public python-pytest-mypy + (package + (name "python-pytest-mypy") + (version "0.9.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-mypy" version)) + (sha256 + (base32 "0p5bd4r4gbwk1h7mpx1jkhdwkckapfz24bp9x5mmqb610ps3pylz")))) + (build-system python-build-system) + (native-inputs (list python-setuptools-scm)) + (propagated-inputs + (list python-attrs python-filelock python-mypy python-pytest)) + (home-page "https://github.com/dbader/pytest-mypy") + (synopsis "Mypy static type checker plugin for Pytest") + (description "@code{pytest-mypi} is a static type checker plugin for +Pytest that runs the mypy static type checker on your source files as part of +a Pytest test execution.") + (license license:expat))) + (define-public python-pytest-pep8 (package (name "python-pytest-pep8") -- cgit v1.2.3 From 3ce8459aa728ce85bd1f67194539a33cec0a9d1b Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 13:36:25 -0400 Subject: gnu: Add python-pytest-freezegun. * gnu/packages/check.scm (python-pytest-freezegun): New variable. --- gnu/packages/check.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 75b42b945a..1db4457dde 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2200,6 +2200,38 @@ style test suites, summarizing their results, and providing indication of failures.") (license license:ncsa))) +(define-public python-pytest-freezegun + (package + (name "python-pytest-freezegun") + (version "0.4.2") + (source (origin + ;; The test suite is not included in the PyPI archive. + (method git-fetch) + (uri (git-reference + (url "https://github.com/ktosiek/pytest-freezegun") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "10c4pbh03b4s1q8cjd75lr0fvyf9id0zmdk29566qqsmaz28npas")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-vv"))))))) + (propagated-inputs (list python-freezegun python-pytest)) + (native-inputs (list unzip)) + (home-page "https://github.com/ktosiek/pytest-freezegun") + (synopsis "Pytest plugin to freeze time in test fixtures") + (description "The @code{pytest-freezegun} plugin wraps tests and fixtures +with @code{freeze_time}, which allows to control (i.e., freeze) the time seen +by the test.") + (license license:expat))) + (define-public python-pytest-mypy (package (name "python-pytest-mypy") -- cgit v1.2.3 From e96c2dcabf898c8aaebe4191922cb186f43f376c Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 13:45:16 -0400 Subject: gnu: Add python-pytest-enabler-bootstrap. * gnu/packages/check.scm (python-pytest-enabler-bootstrap): New variable. --- gnu/packages/check.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 1db4457dde..135fd671a2 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2200,6 +2200,31 @@ style test suites, summarizing their results, and providing indication of failures.") (license license:ncsa))) +;;; This is marked as a bootstrap package because it propagates bootstrapped +;;; versions of jaraco-context and jaraco-functools. +(define-public python-pytest-enabler-bootstrap + (hidden-package + (package + (name "python-pytest-enabler-bootstrap") + (version "1.2.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pytest-enabler" version)) + (sha256 + (base32 "023ymm0r2gpn5q7aikvx567s507j0zk46w41w6gxb69c688zgs73")))) + (build-system python-build-system) + (arguments (list #:tests? #f)) + (propagated-inputs + (list python-jaraco-context-bootstrap + python-jaraco-functools-bootstrap + python-toml)) + (native-inputs (list python-setuptools-scm)) + (home-page "https://github.com/jaraco/pytest-enabler") + (synopsis "Enable installed pytest plugins") + (description "Enable installed pytest plugins") + (license license:expat)))) + (define-public python-pytest-freezegun (package (name "python-pytest-freezegun") -- cgit v1.2.3 From 9010b1adfd0c876e9a5971a373ae620378aca686 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 6 Apr 2022 00:28:29 -0400 Subject: gnu: Add python-pytest-enabler. * gnu/packages/check.scm (python-pytest-enabler): New variable. --- gnu/packages/check.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 135fd671a2..8ed53f7e27 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2225,6 +2225,36 @@ failures.") (description "Enable installed pytest plugins") (license license:expat)))) +(define-public python-pytest-enabler + (package/inherit python-pytest-enabler-bootstrap + (arguments + (substitute-keyword-arguments + (package-arguments python-pytest-enabler-bootstrap) + ((#:tests? _ #f) + #t) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "pytest" "-vv" "tests")))))))) + (propagated-inputs + (modify-inputs (package-propagated-inputs python-pytest-enabler-bootstrap) + (replace "python-jaraco-context-bootstrap" python-jaraco-context) + (replace "python-jaraco-functools-bootstrap" python-jaraco-functools))) + (native-inputs + (modify-inputs (package-native-inputs python-pytest-enabler-bootstrap) + (append python-pytest + python-pytest-black + python-pytest-checkdocs + python-pytest-cov + python-pytest-flake8 + python-pytest-mypy + python-types-toml))) + (properties (alist-delete 'hidden? + (package-properties + python-pytest-enabler-bootstrap))))) + (define-public python-pytest-freezegun (package (name "python-pytest-freezegun") -- cgit v1.2.3 From 9175b8d6ba7c5939bfee3b76904ee8627f38f949 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 5 Apr 2022 15:04:55 -0400 Subject: gnu: Add python-pytest-perf. * gnu/packages/check.scm (python-pytest-perf): New variable. --- gnu/packages/check.scm | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 8ed53f7e27..e3523d77dc 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2344,6 +2344,64 @@ a Pytest test execution.") (define-public python2-pytest-pep8 (package-with-python2 python-pytest-pep8)) +(define-public python-pytest-perf + (package + (name "python-pytest-perf") + (version "0.12.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jaraco/pytest-perf") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05mgknvrmyz1kmkgw8jzvisavc68wz1g2wxv69i6xvzgqxf17m9f")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "pytest" "-k" + (string-append + ;; Do not test the myproject.toml build as it tries to pull + ;; dependencies from the internet. + "not project " + ;; The benchmark test attempts to install the + ;; package, failing to pull its dependencies from the + ;; network. + "and not BenchmarkRunner " + ;; The upstream_url test requires networking. + "and not upstream_url")))))))) + (native-inputs + (list python-pytest + python-pytest-black + python-pytest-checkdocs + python-pytest-cov + python-pytest-enabler + python-pytest-flake8 + python-pytest-mypy)) + (propagated-inputs + (list python-jaraco-context + python-jaraco-functools + python-more-itertools + python-packaging + python-pip-run + python-tempora)) + (home-page "https://github.com/jaraco/pytest-perf") + (synopsis "Pytest plugin for performance testing") + (description "@code{pytest-perf} makes it easy to compare works by +creating two installs, the control and the experiment, and measuring the +performance of some Python code against each. Under the hood, it uses the +@command{pip-run} command to install from the upstream main +branch (e.g. https://github.com/jaraco/pytest-perf) for the control and from +@file{.} for the experiment. It then runs each of the experiments against +each of the environments.") + (license license:expat))) + (define-public python-pytest-flakes (package (name "python-pytest-flakes") -- cgit v1.2.3 From 1702331d016eba117124299b68ab77cc1ed22270 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 6 Apr 2022 09:16:07 -0400 Subject: gnu: Add python-pytest-randomly. * gnu/packages/check.scm (python-pytest-randomly): New variable. --- gnu/packages/check.scm | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index e3523d77dc..c67a6f2675 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1242,6 +1242,47 @@ tests. Tests can be rerun in a specific order by passing a seed value reported in a previous test run.") (license license:expat))) +(define-public python-pytest-randomly + (package + (name "python-pytest-randomly") + (version "3.11.0") + (source (origin + (method git-fetch) ;no tests in pypi archive + (uri (git-reference + (url "https://github.com/pytest-dev/pytest-randomly") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1sjgq49g8f8973vhmzrim79b6wz29a765n99azjk1maimqh7mmik")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; The tests validating ordering fail, as well as as two + ;; others, for unknown reasons (see: + ;; https://github.com/pytest-dev/pytest-randomly/issues/454). + (invoke "pytest" "-vv" "-k" + (string-append + "not reordered " + "and not test_it_runs_before_stepwise " + "and not test_entrypoint_injection")))))))) + (native-inputs (list python-coverage + python-factory-boy + python-faker + python-numpy + python-pytest-xdist)) + (propagated-inputs (list python-importlib-metadata python-pytest)) + (home-page "https://github.com/pytest-dev/pytest-randomly") + (synopsis "Pytest plugin to randomly order tests") + (description "This is a Pytest plugin to randomly order tests and control +Python's @code{random.seed}.") + (license license:expat))) + (define-public python-pytest-runner (package (name "python-pytest-runner") -- cgit v1.2.3 From 0f8bb67dbb6d21dc56d8237d35fefeee8a3e6dc4 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 6 Apr 2022 15:44:12 -0400 Subject: gnu: python-pytest-cov: Update to 3.0.0. This restores the package compatibility with python-pytest-xdist. * gnu/packages/check.scm (python-pytest-cov): Update to 3.0.0. (python2-pytest-cov): Delete package. --- gnu/packages/check.scm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index c67a6f2675..b7a5a9bd46 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1150,13 +1150,13 @@ following improvements: (define-public python-pytest-cov (package (name "python-pytest-cov") - (version "2.8.1") + (version "3.0.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-cov" version)) (sha256 - (base32 "0avzlk9p4nc44k7lpx9109dybq71xqnggxb9f4hp0l64pbc44ryc")))) + (base32 "0w6lfv8gc1lxmnvsz7mq5z9shxac5zz6s9mwrai108kxc6qzbw77")))) (build-system python-build-system) (arguments `(#:phases @@ -1178,9 +1178,6 @@ 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-with-python2 python-pytest-cov)) - (define-public python-pytest-httpserver (package (name "python-pytest-httpserver") -- cgit v1.2.3 From 476ae98d0bd0be0cddea27edbf99c65c0c798cdb Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 10 Apr 2022 22:04:58 -0400 Subject: gnu: pylint: Run tests in parallel. * gnu/packages/check.scm (python-pylint) [phases]{check}: Add the '-n' option to use xdist with pytest. [native-inputs]: Add python-pytest-xdist. --- gnu/packages/check.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index b7a5a9bd46..005a3bde7c 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2532,9 +2532,10 @@ statements in the module it tests.") (delete-file "tests/primer/test_primer_external.py") (delete-file "tests/testutils/test_package_to_lint.py") (setenv "HOME" "/tmp") - (invoke "pytest" "-k" "test_functional"))))))) + (invoke "pytest" "-k" "test_functional" + "-n" (number->string (parallel-job-count))))))))) (native-inputs - (list python-pytest)) + (list python-pytest python-pytest-xdist)) (propagated-inputs (list python-astroid python-isort -- cgit v1.2.3 From 44dc0f0f0b1129b944e6b0c3d60f1ab9acdaccf9 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 12 Apr 2022 15:14:56 -0400 Subject: gnu: Add python-pytest-forked-next. * gnu/packages/check.scm (python-pytest-forked-next): New variable. --- gnu/packages/check.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 005a3bde7c..5e0b653983 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1570,6 +1570,23 @@ can be useful to isolate tests against undesirable global environment side-effects (such as setting environment variables).") (license license:expat))) +(define-public python-pytest-forked-next + (package + (inherit python-pytest-forked) + (name "python-pytest-forked") + (version "1.4.0") + (source + (origin + (method git-fetch) ;for tests + (uri (git-reference + (url "https://github.com/pytest-dev/pytest-forked") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0j9bbjny7h3b4fig6l26f26c697r67mm62fzdd9m9rqyy2bmnqjs")))) + (native-inputs (list python-pytest-bootstrap python-setuptools-scm)))) + (define-public python-scripttest (package (name "python-scripttest") -- cgit v1.2.3 From 59e51d8f1c1492a2ea876b1f61a4a27372cbcde8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 12 Apr 2022 15:15:06 -0400 Subject: gnu: python-pytest-xdist-next: Update to 2.5.0. * gnu/packages/check.scm (python-pytest-xdist-next): Update to 2.5.0. [propagated-inputs]: replace python-pytest-forked with python-pytest-forked-next. --- gnu/packages/check.scm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 5e0b653983..957d7a4262 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1483,18 +1483,16 @@ result back.") (define-public python-pytest-xdist-next (package/inherit python-pytest-xdist (name "python-pytest-xdist") - (version "2.3.0") + (version "2.5.0") (source (origin (method url-fetch) (uri (pypi-uri "pytest-xdist" version)) (sha256 (base32 - "19cy57jrf3pwi7x6fnbxryjvqagsl0yv736jnynvr3yqhlpxxv78")))) - (propagated-inputs - `(("python-execnet" ,python-execnet) - ("python-pytest" ,python-pytest-6) - ("python-pytest-forked" ,python-pytest-forked))))) + "1psf5dqxvc38qzxvc305mkg5xpdmdkbkkfiyqlmdnkgh7z5dx025")))) + (propagated-inputs (list python-execnet python-pytest + python-pytest-forked-next)))) (define-public python-pytest-timeout (package -- cgit v1.2.3 From bfe7f4065095fde94a44b511ae74186a2dbe880f Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 18 Apr 2022 13:40:35 -0400 Subject: gnu: python-hypothesis-6.23: Update to 6.43.3. * gnu/packages/check.scm (python-hypothesis-6.23): Update to 6.43.3 and rename to... (python-hypothesis-next): ... this. [propagated-inputs]: Add python-pytest. * gnu/packages/matrix.scm (python-matrix-nio): Adjust accordingly. * gnu/packages/python-web.scm (python-h2): Likewise. * gnu/packages/check.scm (python-hypothesis)[home-page]: Update URL. --- gnu/packages/check.scm | 12 ++++++++---- gnu/packages/matrix.scm | 2 +- gnu/packages/python-web.scm | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'gnu/packages/check.scm') diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 957d7a4262..8e6576208c 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -2174,20 +2174,24 @@ instantly.") much larger range of examples than you would ever want to write by hand. It’s based on the Haskell library, Quickcheck, and is designed to integrate seamlessly into your existing Python unit testing work flow.") - (home-page "https://github.com/HypothesisWorks/hypothesis-python") + (home-page "https://github.com/HypothesisWorks/hypothesis") (license license:mpl2.0) (properties `((python2-variant . ,(delay python2-hypothesis)))))) -(define-public python-hypothesis-6.23 +;;; TODO: Make the default python-hypothesis in the next rebuild cycle. +(define-public python-hypothesis-next (package (inherit python-hypothesis) - (version "6.23.4") + (version "6.43.3") (source (origin (method url-fetch) (uri (pypi-uri "hypothesis" version)) (sha256 (base32 - "0wp8i9qmd5wl1sq1l2b97fgliyk5fyphssl6j7q5qn5zjlfgi4qs")))))) + "0d67dlc5a47i48fxzmji2mnybzby0h1wdscmj54555fghcyp1045")))) + (propagated-inputs + (modify-inputs (package-propagated-inputs python-hypothesis) + (append python-pytest))))) ;to satisfy the sanity-check phase ;; This is the last version of Hypothesis that supports Python 2. (define-public python2-hypothesis diff --git a/gnu/packages/matrix.scm b/gnu/packages/matrix.scm index 5f94eb2075..9ac999b5fd 100644 --- a/gnu/packages/matrix.scm +++ b/gnu/packages/matrix.scm @@ -187,7 +187,7 @@ homeserver and generally help bootstrap the ecosystem.") (native-inputs `(("python-pytest" ,python-pytest-6) ("python-hyperframe" ,python-hyperframe) - ("python-hypothesis" ,python-hypothesis-6.23) + ("python-hypothesis" ,python-hypothesis-next) ("python-hpack" ,python-hpack) ("python-faker" ,python-faker) ("python-pytest-aiohttp" ,python-pytest-aiohttp) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 9836e81f6c..89b688da32 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -1114,7 +1114,7 @@ and that could be anything you want.") (add-installed-pythonpath inputs outputs) (invoke "python" "-m" "pytest" "-vv" "test"))))))) (native-inputs - (list python-hypothesis-6.23 python-pytest)) + (list python-hypothesis-next python-pytest)) (propagated-inputs (list python-hpack python-hyperframe)) (home-page "https://github.com/python-hyper/h2") -- cgit v1.2.3 From 40a729a0e6f1d660b942241416c1e2c567616d4d Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 15 May 2022 20:20:08 -0400 Subject: gnu: Fix the build of wicd. Fixes . * 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. --- gnu/packages/check.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++- gnu/packages/python-xyz.scm | 32 ++++++++++++++++++++++- gnu/packages/time.scm | 39 +++++++++++++++++++++++++++- 3 files changed, 130 insertions(+), 3 deletions(-) (limited to 'gnu/packages/check.scm') 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 -- cgit v1.2.3