summary refs log tree commit diff
path: root/gnu/packages/check.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-04-05 15:04:55 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-05-12 12:45:33 -0400
commit9175b8d6ba7c5939bfee3b76904ee8627f38f949 (patch)
tree34a33f16afaf3b3d06a654a082d95ac5698cbd4b /gnu/packages/check.scm
parent0be033d3c569450b347b1fe69ff6a52395afc971 (diff)
downloadguix-9175b8d6ba7c5939bfee3b76904ee8627f38f949.tar.gz
gnu: Add python-pytest-perf.
* gnu/packages/check.scm (python-pytest-perf): New variable.
Diffstat (limited to 'gnu/packages/check.scm')
-rw-r--r--gnu/packages/check.scm58
1 files changed, 58 insertions, 0 deletions
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")