1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-08 14:10:38 +02:00
Files
guix/gnu/packages/patches/python-versioneer-guix-support.patch
Nguyễn Gia Phong 44b1ef5971 gnu: python-versioneer: Adjust patch.
* gnu/packages/patches/python-versioneer-guix-support.patch:
  Extract version from the environment variable
  instead of the parent directory name.

Change-Id: Ide050eeb8fbb82c29805fce74d891d62b7e707cb
Reviewed-by: Nicolas Graves <ngraves@ngraves.fr>
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-04-04 22:41:47 +01:00

24 lines
757 B
Diff

Versioneer does not work in the Guix build container because:
* VCS information is unavailable
* the build directory does not have the supported "$name-$version" format
* as of 0.21, versioneer has no way to override the discovered values
This patch adds support for extracting version from the
GUIX_VERSIONEER_VERSION environment variable set by the set-version
phase of the pyproject build system.
--- a/src/get_versions.py
+++ b/src/get_versions.py
@@ -19,6 +19,10 @@
# see the discussion in cmdclass.py:get_cmdclass()
del sys.modules["versioneer"]
+ ver = {"version": os.getenv("GUIX_VERSIONEER_VERSION")}
+ if ver["version"] is not None:
+ return ver
+
root = get_root()
cfg = get_config_from_root(root)