e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
69 lines
1.3 KiB
Nix
69 lines
1.3 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 ];
|
|
};
|
|
}
|