fa5436e0a7
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
60 lines
1.2 KiB
Nix
60 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
callPackage,
|
|
fetchPypi,
|
|
pythonOlder,
|
|
|
|
# build-system
|
|
setuptools,
|
|
|
|
# dependencies
|
|
packaging,
|
|
typing-extensions,
|
|
tomli,
|
|
|
|
# optional-dependencies
|
|
rich,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "setuptools-scm";
|
|
version = "8.0.4";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-tfQ/9oAGaVlRk/0JiRVk7p0dfcsZbKtLJQbVOi4clcc=";
|
|
};
|
|
|
|
nativeBuildInputs = [ setuptools ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
|
|
|
propagatedBuildInputs = [
|
|
packaging
|
|
setuptools
|
|
typing-extensions
|
|
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
|
|
|
|
passthru.optional-dependencies = {
|
|
rich = [ rich ];
|
|
};
|
|
|
|
pythonImportsCheck = [ "setuptools_scm" ];
|
|
|
|
# check in passthru.tests.pytest to escape infinite recursion on pytest
|
|
doCheck = false;
|
|
|
|
passthru.tests = {
|
|
pytest = callPackage ./tests.nix { };
|
|
};
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
meta = with lib; {
|
|
changelog = "https://github.com/pypa/setuptools_scm/blob/${version}/CHANGELOG.md";
|
|
homepage = "https://github.com/pypa/setuptools_scm/";
|
|
description = "Handles managing your python package versions in scm metadata";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ nickcao ];
|
|
};
|
|
}
|