guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 351d5bc5ced3884fc9091159956883fff5b7e5c8
Author: Nguyễn Gia Phong <[email protected]>
AuthorDate: Fri Feb 20 17:20:24 2026 +0900

    gnu: Remove phase done by set-version in pyproject-build-system.
    
    * gnu/packages/astronomy.scm (python-kanon)[arguments]<#:phases>:
      Remove 'relax-requirements and 'set-version.
      (python-drizzlepac, python-stpipe)[arguments]<#:phases>:
      Remove 'set-version.
    * gnu/packages/machine-learning.scm
      (python-botorch)[arguments]<#:phases>: Remove 'pretend-version.
    * gnu/packages/openstack.scm
      (python-os-testr, python-requestsexceptions)[arguments]<#:phases>:
      Remove 'set-version.
    * gnu/packages/package-management.scm
      (python-conda-libmamba-solver)[arguments]<#:phases>:
      Remove 'set-version.
    * gnu/packages/patchutils.scm (pwclient)[arguments]<#:phases>:
      Remove 'set-PBR_VERSION.
    * gnu/packages/python-check.scm
      (python-aioresponses)[arguments]<#:phases>: Remove 'set-pbr-version.
    * gnu/packages/python-science.scm
      (python-modin, python-plotly, python-pytensor)[arguments]<#:phases>:
      Remove 'versioneer.
      (snakemake-5, snakemake-6, snakemake-7)[arguments]<#:phases>:
      Remove 'patch-version.
    * gnu/packages/python-web.scm (python-alpaca-py)[arguments]<#:phases>:
      Remove 'set-version.
    * gnu/packages/python-xyz.scm
      (python-clyent, python-logical-unification)[arguments]<#:phases>:
      Remove 'versioneer.
      (python-debugpy, python-strenum)[arguments]<#:phases>:
      Remove 'fix-version.
      (python-qstylizer)[arguments]<#:phases>: Remove 'set-pbr-version.
      (python-retry)[arguments]<#:phases>: Remove 'set-version.
    * gnu/packages/statistics.scm (python-pymc)[arguments]<#:phases>:
      Remove 'versioneer.
    
    Change-Id: I7b4557c576730e47575305f4f03bfe2523412c6c
    Reviewed-by: Nicolas Graves <[email protected]>
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/astronomy.scm          | 27 ++---------------
 gnu/packages/machine-learning.scm   |  9 +-----
 gnu/packages/openstack.scm          | 10 ++-----
 gnu/packages/package-management.scm |  3 --
 gnu/packages/patchutils.scm         |  3 --
 gnu/packages/python-check.scm       |  7 +----
 gnu/packages/python-science.scm     | 59 +------------------------------------
 gnu/packages/python-web.scm         |  8 -----
 gnu/packages/python-xyz.scm         | 50 +------------------------------
 gnu/packages/statistics.scm         | 13 ++------
 10 files changed, 10 insertions(+), 179 deletions(-)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 0a949e5078..0c51af4b52 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -4494,11 +4494,7 @@ code to be greatly simplified.")
       #~(modify-phases %standard-phases
           ;; TODO: Sanity check phase fails a lot on mismatched versions or
           ;; failed to load "stsci.tools" module.
-          (delete 'sanity-check)
-          (add-before 'build 'set-version
-            (lambda _
-              (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
-                      #$(version-major+minor+point version)))))))
+          (delete 'sanity-check))))
     (native-inputs
      (list python-ci-watson
            python-crds-minimal
@@ -6241,19 +6237,6 @@ files.")
                  (string-append
                   "from astropy.units.core import Unit, UnitBase\n"
                   "from astropy.units.errors import UnitTypeError\n")))))
-          (add-after 'unpack 'relax-requirements
-            (lambda _
-              (substitute* "pyproject.toml"
-                ;; RuntimeError: Unable to detect version control
-                ;; system. Checked: Git. Not installed: Mercurial, Darcs,
-                ;; Subversion, Bazaar, Fossil, Pijul.  See
-                ;; <https://github.com/blacklanternsecurity/bbot/issues/1257>.
-                (("enable = true") "enable = false"))))
-          (add-before 'build 'set-version
-            (lambda _
-              ;; TODO: Include in pyproject-build-system.
-              (setenv "POETRY_DYNAMIC_VERSIONING_BYPASS"
-                      #$(version-major+minor+point version))))
           (add-before 'check 'prepare-test-environment
             (lambda _
               (setenv "HOME" "/tmp"))))))
@@ -9796,13 +9779,7 @@ implemented in the @acronym{JWST, James Webb Space 
Telescope} and
                             "test_step.py::test_build_config_pipe_kwarg"
                             "test_step.py::test_build_config_step_config_file"
                             "test_step.py::test_build_config_step_kwarg"
-                            "test_step.py::test_step_list_args")))
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'set-version
-            (lambda _
-              (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
-                      #$(version-major+minor+point version)))))))
+                            "test_step.py::test_step_list_args")))))
     (native-inputs
      (list python-pytest
            python-pytest-doctestplus
diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index d001221942..fec3a56b12 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -6674,14 +6674,7 @@ linear algebra routines needed for structured matrices 
(or operators).")
                    ;; PyTorch 2.10 rejects passing a torch.Size plus extra 
args to `view'.
                    (substitute* "botorch/utils/multi_objective/hypervolume.py"
                      (("self\\._batch_sample_shape, *\\*obj\\.shape\\[-2:\\]")
-                      "self._batch_sample_shape"))))
-               (add-before 'build 'pretend-version
-                 ;; The version string is usually derived via setuptools-scm,
-                 ;; but without the git metadata available, the version string
-                 ;; is set to '0.0.0'.
-                 (lambda _
-                   (setenv "SETUPTOOLS_SCM_PRETEND_VERSION"
-                           #$(package-version this-package)))))))
+                      "self._batch_sample_shape")))))))
     (propagated-inputs (list python-gpytorch
                              python-linear-operator
                              python-multipledispatch
diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm
index ae2d06e52c..eabd6dc6f5 100644
--- a/gnu/packages/openstack.scm
+++ b/gnu/packages/openstack.scm
@@ -282,10 +282,7 @@ is for some reason not possible and local caching of the 
fetched data.")
               (lambda _
                 (substitute* "test-requirements.txt"
                   (("(coverage|hacking).*")
-                   ""))))
-            (add-after 'unpack 'set-version
-              (lambda _
-                (setenv "PBR_VERSION" "3.0.0"))))))
+                   "")))))))
       (propagated-inputs (list python-stestr))
       (native-inputs
        (list python-babel
@@ -1168,10 +1165,7 @@ Gerrit for review, or fetching existing ones.")
             (lambda _
               (substitute* "test-requirements.txt"
                 (("hacking.*")
-                 ""))))
-          (add-after 'unpack 'set-version
-            (lambda _
-              (setenv "PBR_VERSION" #$version))))))
+                 "")))))))
     (native-inputs (list python-os-testr python-pbr python-setuptools))
     (home-page "https://github.com/openstack/requestsexceptions";)
     (synopsis
diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index 6cb28d30d3..bc89d114ed 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1859,9 +1859,6 @@ enabling fast package management functionality in Python 
applications.")
               "--ignore=tests/test_workarounds.py")   ; network: workarounds
       #:phases
       #~(modify-phases %standard-phases
-          (add-before 'build 'set-version
-            (lambda _
-              (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
           (add-before 'check 'set-home
             (lambda _
               (setenv "HOME" "/tmp"))))))
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index b980359edc..8d3c6d6a3d 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -672,9 +672,6 @@ patches do not match perfectly.")
      (list
       #:phases
       #~(modify-phases %standard-phases
-          (add-before 'build 'set-PBR_VERSION
-            (lambda _
-              (setenv "PBR_VERSION" #$version)))
           (add-after 'install 'install-man-page
             (lambda _
               (install-file "man/pwclient.1"
diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index cd55b86fef..296f2df921 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -154,12 +154,7 @@ other external or custom tools for further processing.")
          (string-append
           ;; These tests require network access.
           "not test_address_as_instance_of_url_combined_with_pass_through "
-          "and not test_pass_through_with_origin_params"))
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'set-pbr-version
-            (lambda _
-              (setenv "PBR_VERSION" #$version))))))
+          "and not test_pass_through_with_origin_params"))))
     (native-inputs (list python-pbr python-ddt python-pytest 
python-setuptools))
     (propagated-inputs (list python-aiohttp))
     (home-page "https://github.com/pnuckowski/aioresponses";)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index c25be19ac8..5603bde999 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1703,12 +1703,6 @@ spheres, cubes, etc.")
               "modin/tests/numpy")
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'versioneer
-            (lambda _
-              (invoke "versioneer" "install")
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (string-append "version='" #$version "',")))))
           (add-after 'unpack 'fix-pytest-config
             (lambda _
               (substitute* "setup.cfg"
@@ -5119,14 +5113,6 @@ objects.")
                             "test_destroyhandler.py::test_misc")))
       #:phases
       #~(modify-phases %standard-phases
-          ;; Replace version manually because pytensor uses
-          ;; versioneer, which requires git metadata.
-          (add-after 'unpack 'versioneer
-            (lambda _
-              (invoke "versioneer" "install")
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version)))))
           (add-before 'check 'pre-check
             (lambda _
               ;; It is required for most tests.
@@ -5380,18 +5366,7 @@ and more
             ;; npm is not packaged so build without it
             (lambda _
               (setenv "SKIP_NPM" "T")))
-          (add-after 'unpack 'fix-version
-            ;; TODO: Versioneer in Guix gets its release version from the
-            ;; parent directory, but the plotly package is located inside a
-            ;; depth 3 subdirectory.  Try to use versioneer if possible.
-            (lambda _
-              (substitute* "packages/python/plotly/setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version)))
-              (substitute* "packages/python/plotly/plotly/version.py"
-                (("__version__ = get_versions\\(\\)\\[\"version\"\\]")
-                 (format #f "__version__ = ~s" #$version)))))
-          (add-after 'fix-version 'chdir
+          (add-after 'unpack 'chdir
             (lambda _
               (chdir "packages/python/plotly"))))))
     ;; XXX: Plotly requires a long list of test only packages, do not
@@ -6383,14 +6358,6 @@ are source structure, project manager, interactive help, 
workspace...")
                  (string-append
                   "tibanna_args.command = command.replace('"
                   #$output "/bin/snakemake', 'python3 -m snakemake')")))))
-          (add-after 'unpack 'patch-version
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(\\)")
-                 (format #f "version=~s" #$version)))
-              (substitute* '("snakemake/_version.py"
-                             "versioneer.py")
-                (("0\\+unknown") #$version))))
           (add-before 'check 'pre-check
             (lambda* (#:key tests?  #:allow-other-keys)
               (when tests?
@@ -6471,14 +6438,6 @@ Python style, together with a fast and comfortable 
execution environment.")
               (substitute* "snakemake/dag.py"
                 (("\"job\": rule,")
                  "\"job\": rule.name,"))))
-          (add-after 'unpack 'patch-version
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(\\)")
-                 (format #f "version=~s" #$version)))
-              (substitute* '("snakemake/_version.py"
-                             "versioneer.py")
-                (("0\\+unknown") #$version))))
           ;; For cluster execution Snakemake will call Python.  Since there is
           ;; no suitable PYTHONPATH set, cluster execution will fail.  We fix
           ;; this by calling the snakemake wrapper instead.
@@ -6566,14 +6525,6 @@ Python style, together with a fast and comfortable 
execution environment.")
               (substitute* "snakemake/dag.py"
                 (("\"job\": rule,")
                  "\"job\": rule.name,"))))
-          (add-after 'unpack 'patch-version
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(\\)")
-                 (format #f "version=~s" #$version)))
-              (substitute* '("snakemake/_version.py"
-                             "versioneer.py")
-                (("0\\+unknown") #$version))))
           (add-before 'check 'pre-check
             (lambda _ (setenv "HOME" "/tmp"))))))
     (propagated-inputs
@@ -6663,14 +6614,6 @@ Python style, together with a fast and comfortable 
execution environment.")
                  (string-append
                   "tibanna_args.command = command.replace('"
                   #$output "/bin/snakemake', 'python3 -m snakemake')")))))
-          (add-after 'unpack 'patch-version
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(\\)")
-                 (format #f "version=~s" #$version)))
-              (substitute* '("snakemake/_version.py"
-                             "versioneer.py")
-                (("0\\+unknown") #$version))))
           (add-before 'check 'pre-check
             (lambda _ (setenv "HOME" "/tmp"))))))
     (propagated-inputs
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 04980dfe25..0015ca6601 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -234,14 +234,6 @@ writing applications that talk to network enabled embedded
        (sha256
         (base32 "0majn27r2s2z5nbqvkpmw04kswhj9xkmvmm0rkvb3fga9lwwivlb"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'set-version
-            (lambda _
-              (setenv "POETRY_DYNAMIC_VERSIONING_BYPASS"
-                      #$(version-major+minor+point version)))))))
     (native-inputs
      (list python-poetry-core
            python-poetry-dynamic-versioning
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 79df03d1a5..ef69e4ee40 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5235,19 +5235,7 @@ and function call return values in a human-readable 
way.")
        (sha256
         (base32 "0vi9nkd4hnvycwwpz9xip1drc5zn7bdwff1pz3azmyvh8v4hsias"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:test-backend #~'unittest
-      #:phases
-      #~(modify-phases %standard-phases
-          ;; Replace version manually because clyent uses
-          ;; versioneer, which requires git metadata.
-          (add-after 'unpack 'versioneer
-            (lambda _
-              (invoke "versioneer" "install")
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (string-append "version='" #$version "',"))))))))
+    (arguments (list #:test-backend #~'unittest))
     (native-inputs
      (list python-mock
            python-setuptools
@@ -17995,12 +17983,6 @@ and other @acronym{IDEs, Integrated Development 
Environments}.")
               (substitute* "tests/debugpy/test_run.py"
                 (("#!/bin/sh")
                  (string-append "#!" (which "sh"))))))
-          (add-after 'unpack 'fix-version
-            ;; Versioneer is useless when there is no git metadata.
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version)))))
           (add-before 'build 'configure
             (lambda _
               ;; This adjusts the behavior of debugpy to load pydevd from
@@ -19146,13 +19128,6 @@ for atomic file system operations.")
        (sha256
         (base32 "0413msw23kv87fgs14ajp9wb2qxkcw6ydvwjzabz7xcp8iif9kr2"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'set-pbr-version
-            (lambda _
-              (setenv "PBR_VERSION" "3.0.1"))))))
     (native-inputs
      (list python-pbr
            python-pytest
@@ -31796,13 +31771,6 @@ implementations.")
        (sha256
         (base32 "1a35ihsn082626592bkjc41fywylzp603j0cxpkbm2f7l1k332xv"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-before 'build 'set-version
-            (lambda _
-              (setenv "PBR_VERSION" #$version))))))
     (native-inputs (list python-pbr python-pytest))
     (propagated-inputs (list python-decorator python-py))
     (home-page "https://github.com/invl/retry";)
@@ -32967,16 +32935,6 @@ needed and registers the function with its 
annotations.")
        (sha256
         (base32 "1pciaw3vd7awcnszkqda7l17y3gdzb8ca2cr4p5j0x3b8r28izx8"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'versioneer
-            (lambda _
-              (invoke "versioneer" "install")
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version))))))))
     (native-inputs
      (list python-pytest
            python-pytest-benchmark
@@ -36404,12 +36362,6 @@ in Rust, with a nice Python API provided on top.")
       #~(list "--ignore=doc/")
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'fix-version
-            ;; Versioneer is useless when there is no git metadata.
-            (lambda _
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version)))))
           (add-after 'unpack 'fix-pytest-config
             (lambda _
               (substitute* "pytest.ini"
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 2e92f11b07..bb1db3a2c1 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -1137,17 +1137,8 @@ algorithms for evaluating Bayesian evidence.")
        (sha256
         (base32 "0n2qj13qpd58qg8s5gx2qxiiy7hjpk6k8z0a4ysr3jc66d12s092"))))
     (build-system pyproject-build-system)
-    (arguments
-     (list
-      #:tests? #f ; tests are too computationally intensive
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'versioneer
-            (lambda _
-              (invoke "versioneer" "install")
-              (substitute* "setup.py"
-                (("version=versioneer.get_version\\(),")
-                 (format #f "version=~s," #$version))))))))
+    ;; Tests are too computationally intensive
+    (arguments '(#:tests? #f))
     (native-inputs
      (list python-setuptools
            python-versioneer))

Reply via email to