From 53f18b563c4d51f96187d0f411b6e5fadea945ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Fri, 20 Feb 2026 17:20:24 +0900 Subject: [PATCH] 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-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-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 Signed-off-by: Sharlatan Hellseher --- gnu/packages/astronomy.scm | 21 +--------- 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 | 36 ------------------ gnu/packages/statistics.scm | 13 +------ 10 files changed, 8 insertions(+), 161 deletions(-) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index 9807eca7cd..a846b81123 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -6326,19 +6326,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 - ;; . - (("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")))))) @@ -9923,13 +9910,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 87ef7fa86f..f9c6586041 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -6753,14 +6753,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 446916a0e3..0503b2fa25 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 997b5e5051..f66c9d791a 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 6627ae4bc9..85d48216ea 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -1749,12 +1749,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" @@ -5193,14 +5187,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. @@ -5454,18 +5440,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 @@ -6458,14 +6433,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? @@ -6546,14 +6513,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. @@ -6641,14 +6600,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 @@ -6738,14 +6689,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 ad288eb6e0..a9a935487d 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 d626327344..4f55a3f52f 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -18224,12 +18224,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 @@ -19375,13 +19369,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 @@ -32025,13 +32012,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") @@ -33196,16 +33176,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 @@ -36684,12 +36654,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 52179238cb..1e5291b90f 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))