depot/third_party/nixpkgs/pkgs/development/python-modules/versioningit/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

70 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, importlib-metadata
, packaging
, setuptools
, tomli
, pytestCheckHook
, build
, pydantic
, pytest-mock
, git
, mercurial
}:
buildPythonPackage rec {
pname = "versioningit";
version = "2.1.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-c/KWXjDS6/1/+ra/JjaPIjdXBiLdKknH+8GZXenGdtY=";
};
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
] ++ lib.optionals (pythonOlder "3.11") [
tomli
];
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 ];
};
}