2022-10-06 18:32:54 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, importlib-metadata
|
|
|
|
, packaging
|
|
|
|
, setuptools
|
|
|
|
, tomli
|
|
|
|
, pytestCheckHook
|
|
|
|
, build
|
|
|
|
, pydantic
|
|
|
|
, pytest-mock
|
|
|
|
, git
|
|
|
|
, mercurial
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "versioningit";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "2.1.0";
|
2022-10-06 18:32:54 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-c/KWXjDS6/1/+ra/JjaPIjdXBiLdKknH+8GZXenGdtY=";
|
2022-10-06 18:32:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tox.ini \
|
|
|
|
--replace "--cov=versioningit" "" \
|
|
|
|
--replace "--cov-config=tox.ini" "" \
|
|
|
|
--replace "--no-cov-on-fail" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
|
|
|
setuptools
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-metadata
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.11") [
|
|
|
|
tomli
|
2022-10-06 18:32:54 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
build
|
|
|
|
pydantic
|
|
|
|
pytest-mock
|
|
|
|
git
|
|
|
|
mercurial
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# wants to write to the Nix store
|
|
|
|
"test_editable_mode"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"versioningit"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "setuptools plugin for determining package version from VCS";
|
|
|
|
homepage = "https://github.com/jwodder/versioningit";
|
|
|
|
changelog = "https://versioningit.readthedocs.io/en/latest/changelog.html";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ DeeUnderscore ];
|
|
|
|
};
|
|
|
|
}
|