Merge pull request #236246 from mweinelt/pdm-backend-hook
python310Packages.pdm-backend: set package version through setup-hook
This commit is contained in:
@@ -27,9 +27,7 @@ buildPythonPackage rec {
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'dynamic = ["version"]' 'version = "${version}"' \
|
||||
--replace 'license = "ISC"' 'license = {file = "LICENSE"}' \
|
||||
--replace 'version = {source = "scm"}' 'license-expression = "ISC"'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -40,7 +40,6 @@ buildPythonPackage rec {
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'license = "ISC"' 'license = {text = "ISC"}' \
|
||||
--replace 'dynamic = ["version"]' 'version = "${version}"'
|
||||
'';
|
||||
|
||||
pythonImportsCheck = [
|
||||
|
||||
@@ -40,6 +40,8 @@ buildPythonPackage rec {
|
||||
setuptools
|
||||
];
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/pdm-project/pdm-backend";
|
||||
changelog = "https://github.com/pdm-project/pdm-backend/releases/tag/${version}";
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
version-pretend-hook() {
|
||||
echo "Setting PDM_BUILD_SCM_VERSION to $version"
|
||||
export PDM_BUILD_SCM_VERSION=$version
|
||||
}
|
||||
|
||||
if [ -z "${dontSetPdmBackendVersion-}" ]; then
|
||||
preBuildHooks+=(version-pretend-hook)
|
||||
fi
|
||||
Reference in New Issue
Block a user