diff mbox series

[bug#57094,7/9] gnu: Add python-nox.

Message ID 20220809224333.28437-7-ngraves@ngraves.fr
State New
Headers show
Series [bug#57094,1/9] gnu: python-django-modelcluster: Update to 6.0. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Nicolas Graves Aug. 9, 2022, 10:43 p.m. UTC
* gnu/packages/python-check.scm (python-nox): New variable.
---
 gnu/packages/python-check.scm | 51 +++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index af0e5be28b..20ab26facf 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -107,6 +107,57 @@  (define-public python-beartype
 written in pure Python.")
     (license license:expat)))
 
+(define-public python-nox
+  (package
+    (name "python-nox")
+    (version "2022.1.7")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "nox" version))
+              (sha256
+               (base32
+                "0zkxv7y5952kizri6bnac3gq1kah3b7d1f3lmcpxzfdhxf626xdk"))))
+    (build-system python-build-system)
+    (propagated-inputs (list python-argcomplete
+                             python-colorlog
+                             python-importlib-metadata
+                             python-packaging
+                             python-py
+                             python-typing-extensions
+                             python-virtualenv))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; XXX: PEP 517 manual build/install procedures copied from
+          ;; python-isort.
+          (replace 'build
+            (lambda _
+              ;; ZIP does not support timestamps before 1980.
+              (setenv "SOURCE_DATE_EPOCH" "315532800")
+              (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((whl (car (find-files "dist" "\\.whl$"))))
+                (invoke "pip" "--no-cache-dir" "--no-input"
+                        "install" "--no-deps" "--prefix" #$output whl))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "pytest" "-vv" "tests")))))))
+    (native-inputs
+     (list python-pypa-build
+           python-pytest
+           python-jinja2
+           python-tox))
+    (home-page "https://nox.thea.codes")
+    (synopsis "Flexible python test automation")
+    (description
+     "This package provides @code{nox}, a command-line tool that automates
+testing in multiple Python environments, similar to @code{tox}. Unlike
+@code{tox}, @code{nox} uses a standard Python file for configuration.")
+    (license license:asl2.0)))
+
 (define-public python-pytest-click
   (package
     (name "python-pytest-click")