setuptools: fix WHEEL file reproducibility by hardcoding version
This commit is contained in:
@@ -19,9 +19,17 @@ buildPythonPackage rec {
|
||||
hash = "sha256-s/gfJc3yxvCE6cjP03vtIZqNFmoZKR3d7+4gTPk1hQg=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./reproducible-wheel.patch
|
||||
];
|
||||
|
||||
# Drop dependency on coherent.license, which in turn requires coherent.build
|
||||
postPatch = ''
|
||||
sed -i "/coherent.licensed/d" pyproject.toml
|
||||
|
||||
# Substitute version for reproducible builds
|
||||
substituteInPlace setuptools/version.py \
|
||||
--replace-fail '@version@' '${version}'
|
||||
'';
|
||||
|
||||
preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
diff --git a/setuptools/version.py b/setuptools/version.py
|
||||
--- a/setuptools/version.py
|
||||
+++ b/setuptools/version.py
|
||||
@@ -1,6 +1,3 @@
|
||||
-from ._importlib import metadata
|
||||
-
|
||||
-try:
|
||||
- __version__ = metadata.version('setuptools') or '0.dev0+unknown'
|
||||
-except Exception:
|
||||
- __version__ = '0.dev0+unknown'
|
||||
+# Hardcoded for reproducible builds
|
||||
+# This avoids runtime metadata queries that can vary between builds
|
||||
+__version__ = '@version@'
|
||||
Reference in New Issue
Block a user