Subject: [bug#70855] [PATCH 61/92] gnu: python-pytest-enabler: Break dependency cycle.

From: Nicolas Graves <[email-masked]>
Date: Fri, 10 May 2024 00:53:56 +0200

* gnu/packages/check.scm
(python-pytest-enabler-bootstrap): Delete variable.
(python-pytest-enabler): Redefine variable.

* gnu/packages/python-xyz.scm
(python-jaraco-classes)[native-inputs]: Remove
python-pytest-enabler-bootstrap.
(python-jaraco-context-bootstrap): Delete variable.
(python-jaraco-context): Redefine variable.
(python-jaraco-functools-bootstrap): Delete variable.
(python-jaraco-functools): Redefine variable.

Change-Id: I96649093009beb7a3d0e9716eced778d4fc800e2
---
 gnu/packages/check.scm      |  80 +++++++-------------
 gnu/packages/python-xyz.scm | 142 +++++++++++++++---------------------
 2 files changed, 85 insertions(+), 137 deletions(-)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 1d0be03d406..880d3cb46f3 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -2474,60 +2474,36 @@ (define-public python-lit
 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-enabler
-  (package/inherit python-pytest-enabler-bootstrap
-    (arguments
-     (substitute-keyword-arguments
-       (strip-keyword-arguments
-         '(#:tests?)
-         (package-arguments python-pytest-enabler-bootstrap))
-       ((#:phases phases #~%standard-phases)
-        #~(modify-phases #$phases
-            (replace 'check
-              (lambda* (#:key tests? #:allow-other-keys)
-                (when tests?
-                  (invoke "python" "-m" "pytest" "-vv" "tests"))))))))
+  (package
+    (name "python-pytest-enabler")
+    (version "1.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-enabler" version))
+       (sha256
+        (base32 "023ymm0r2gpn5q7aikvx567s507j0zk46w41w6gxb69c688zgs73"))))
+    (build-system pyproject-build-system)
+    (arguments (list #:tests? #f
+                     #:test-flags '(list "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)))))
+     (list python-jaraco-context
+           python-jaraco-functools
+           python-toml))
+    (native-inputs (list python-pytest
+                         python-pytest-black
+                         python-pytest-checkdocs
+                         python-pytest-cov
+                         python-pytest-flake8
+                         python-pytest-mypy
+                         python-setuptools
+                         python-setuptools-scm
+                         python-types-toml))
+    (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
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c88e48870c..42bde34a486 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11724,7 +11724,6 @@ (define-public python-jaraco-classes
            python-pytest-black
            python-pytest-checkdocs
            python-pytest-cov
-           python-pytest-enabler-bootstrap ;OK since not propagated
            python-pytest-flake8
            python-pytest-mypy
            python-setuptools-scm
@@ -11799,99 +11798,72 @@ (define-public python-jaraco-collections
 @end itemize")
     (license license:expat)))
 
-;;; Variant used to break a cycle with python-pytest-enabler.
-(define-public python-jaraco-context-bootstrap
-  (hidden-package
-   (package
-     (name "python-jaraco-context-bootstrap")
-     (version "4.1.1")
-     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "jaraco.context" version))
-        (sha256
-         (base32 "0hbjm1rpxf4pzmbdp9rh3ali4zqnlcr8m97bhh1nizxvzcpxim7h"))))
-     (build-system pyproject-build-system)
-     (arguments (list #:tests? #f))
-     (native-inputs (list python-setuptools-scm))
-     (home-page "https://github.com/jaraco/jaraco.context")
-     (synopsis "Context managers Python library")
-     (description "This Python library provides context managers-related
-procedures.")
-     (license license:expat))))
-
 (define-public python-jaraco-context
-  (package/inherit python-jaraco-context-bootstrap
+  (package
     (name "python-jaraco-context")
+    (version "4.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jaraco.context" version))
+       (sha256
+        (base32 "0hbjm1rpxf4pzmbdp9rh3ali4zqnlcr8m97bhh1nizxvzcpxim7h"))))
+    (build-system pyproject-build-system)
     (arguments
-     (substitute-keyword-arguments
-         (package-arguments python-jaraco-context-bootstrap)
-       ((#:tests? _ #f)
-        (not (%current-target-system)))
-       ;; Do not test the myproject.toml build as it pulls dependencies.
-       ((#:test-flags test-flags '())
-        '(list "-k" "not project"))))
+     (list #:tests? (not (%current-target-system))
+           ;; Do not test the myproject.toml build as it pulls dependencies.
+           #:test-flags '(list "-k" "not project")))
     (native-inputs
-     (modify-inputs
-         (package-native-inputs python-jaraco-context-bootstrap)
-       (append python-pytest
-               python-pytest-black
-               python-pytest-checkdocs
-               python-pytest-cov
-               python-pytest-enabler-bootstrap ;OK since not propagated
-               python-pytest-flake8
-               python-pytest-mypy)))
-    (properties (alist-delete 'hidden? (package-properties
-                                        python-jaraco-context-bootstrap)))))
-
-;;; Variant used to break a cycle with python-pytest-enabler.
-(define-public python-jaraco-functools-bootstrap
-  (hidden-package
-   (package
-     (name "python-jaraco-functools-bootstrap")
-     (version "3.5.0")
-     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "jaraco.functools" version))
-        (sha256
-         (base32 "186xqzs3bqhjwajnprxy3sc3h0w5vdld8spc1dxjnn9720yykq1i"))))
-     (build-system pyproject-build-system)
-     (arguments (list #:tests? #f))
-     (native-inputs (list python-setuptools-scm))
-     (propagated-inputs (list python-more-itertools))
-     (home-page "https://github.com/jaraco/jaraco.functools")
-     (synopsis "Python library extending Python's @code{functools}")
-     (description "This library extends the standard @code{functools} Python
-module with a few extra procedures.")
-     (license license:expat))))
+     (list python-pytest
+           python-pytest-black
+           python-pytest-checkdocs
+           python-pytest-cov
+           python-pytest-flake8
+           python-pytest-mypy
+           python-setuptools
+           python-setuptools-scm
+           python-wheel))
+    (home-page "https://github.com/jaraco/jaraco.context")
+    (synopsis "Context managers Python library")
+    (description "This Python library provides context managers-related
+procedures.")
+    (license license:expat)))
 
 (define-public python-jaraco-functools
-  (package/inherit python-jaraco-functools-bootstrap
+  (package
     (name "python-jaraco-functools")
+    (version "3.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jaraco.functools" version))
+       (sha256
+        (base32 "186xqzs3bqhjwajnprxy3sc3h0w5vdld8spc1dxjnn9720yykq1i"))))
+    (build-system pyproject-build-system)
     (arguments
-     (substitute-keyword-arguments
-         (package-arguments python-jaraco-functools-bootstrap)
-       ((#:tests? _ #f)
-        (not (%current-target-system)))
-       ;; Do not test the myproject.toml build as it pulls dependencies.
-       ;; Do not run a test that tries to emulate a broken proprietary CI
-       ;; set-up, fails to do so correctly, and then throws an error.
-       ((#:test-flags test-flags '())
-        '(list "-k" "not project and not test_function_throttled"))))
+     (list #:tests? (not (%current-target-system))
+           ;; Do not test the myproject.toml build as it pulls dependencies.
+           ;; Do not run a test that tries to emulate a broken proprietary
+           ;; CI set-up, fails to do so correctly, and then throws an error.
+           #:test-flags
+           '(list "-k" "not project and not test_function_throttled")))
     (native-inputs
-     (modify-inputs
-         (package-native-inputs python-jaraco-functools-bootstrap)
-       (append python-jaraco-classes
-               python-pytest
-               python-pytest-black
-               python-pytest-checkdocs
-               python-pytest-cov
-               python-pytest-enabler-bootstrap ;OK since not propagated
-               python-pytest-flake8
-               python-pytest-mypy)))
-    (properties (alist-delete 'hidden? (package-properties
-                                        python-jaraco-functools-bootstrap)))))
+     (list python-jaraco-classes
+           python-pytest
+           python-pytest-black
+           python-pytest-checkdocs
+           python-pytest-cov
+           python-pytest-flake8
+           python-pytest-mypy
+           python-setuptools
+           python-setuptools-scm
+           python-wheel))
+    (propagated-inputs (list python-more-itertools))
+    (home-page "https://github.com/jaraco/jaraco.functools")
+    (synopsis "Python library extending Python's @code{functools}")
+    (description "This library extends the standard @code{functools} Python
+module with a few extra procedures.")
+    (license license:expat)))
 
 (define-public python-jaraco-packaging
   (package
-- 
2.41.0