nixpkgs/pkgs/development/python-modules/setuptools-git-versioning/default.nix
Martin Weinelt b79da2786f Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
	pkgs/development/python-modules/bundlewrap/default.nix
	pkgs/development/python-modules/coverage/default.nix
	pkgs/development/python-modules/h5netcdf/default.nix
	pkgs/development/python-modules/hypothesis/default.nix
	pkgs/development/python-modules/numba/default.nix
	pkgs/development/python-modules/optype/default.nix
	pkgs/development/python-modules/setuptools-git-versioning/default.nix
	pkgs/development/python-modules/sphinx/default.nix
2026-02-15 16:17:41 +01:00

75 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
build,
coverage,
git,
packaging,
pytestCheckHook,
pytest-rerunfailures,
setuptools,
tomli-w,
}:
buildPythonPackage rec {
pname = "setuptools-git-versioning";
version = "3.0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "dolfinus";
repo = "setuptools-git-versioning";
tag = "v${version}";
hash = "sha256-rAJ9OvSKhQ3sMN5DlUg2tfR42Ae7jjz9en3gfRnXb3I=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
'';
build-system = [
packaging
setuptools
];
dependencies = [
packaging
setuptools
];
pythonImportsCheck = [ "setuptools_git_versioning" ];
nativeCheckInputs = [
build
coverage
git
pytestCheckHook
pytest-rerunfailures
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"
];
disabledTests = [
# runs an isolated build that uses internet to download dependencies
"test_config_not_used"
];
meta = {
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";
license = lib.licenses.mit;
};
}