mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-26 02:05:02 +00:00
python3Packages.setuptools-git-versioning: modernize
This commit is contained in:
@@ -2,17 +2,19 @@
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
addBinToPathHook,
|
||||
build,
|
||||
coverage,
|
||||
git,
|
||||
packaging,
|
||||
pyprojectVersionPatchHook,
|
||||
pytestCheckHook,
|
||||
pytest-rerunfailures,
|
||||
setuptools,
|
||||
tomli-w,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "setuptools-git-versioning";
|
||||
version = "3.0.1";
|
||||
pyproject = true;
|
||||
@@ -20,14 +22,11 @@ buildPythonPackage rec {
|
||||
src = fetchFromGitHub {
|
||||
owner = "dolfinus";
|
||||
repo = "setuptools-git-versioning";
|
||||
tag = "v${version}";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-rAJ9OvSKhQ3sMN5DlUg2tfR42Ae7jjz9en3gfRnXb3I=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||
'';
|
||||
nativeBuildInputs = [ pyprojectVersionPatchHook ];
|
||||
|
||||
build-system = [
|
||||
packaging
|
||||
@@ -42,6 +41,7 @@ buildPythonPackage rec {
|
||||
pythonImportsCheck = [ "setuptools_git_versioning" ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
addBinToPathHook
|
||||
build
|
||||
coverage
|
||||
git
|
||||
@@ -50,11 +50,6 @@ buildPythonPackage rec {
|
||||
tomli-w
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
# so that its built binary is accessible by tests
|
||||
export PATH="$out/bin:$PATH"
|
||||
'';
|
||||
|
||||
# limit tests because the full suite takes several minutes to run
|
||||
enabledTestMarks = [
|
||||
"important"
|
||||
@@ -69,7 +64,7 @@ buildPythonPackage rec {
|
||||
description = "Use git repo data (latest tag, current commit hash, etc) for building a version number according PEP-440";
|
||||
mainProgram = "setuptools-git-versioning";
|
||||
homepage = "https://github.com/dolfinus/setuptools-git-versioning";
|
||||
changelog = "https://github.com/dolfinus/setuptools-git-versioning/blob/${src.tag}/CHANGELOG.rst";
|
||||
changelog = "https://github.com/dolfinus/setuptools-git-versioning/blob/${finalAttrs.src.tag}/CHANGELOG.rst";
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user