1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, importlib-metadata
6, packaging
7, setuptools
8, tomli
9, pytestCheckHook
10, build
11, pydantic
12, pytest-mock
13, git
14, mercurial
15}:
16
17buildPythonPackage rec {
18 pname = "versioningit";
19 version = "2.1.0";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-c/KWXjDS6/1/+ra/JjaPIjdXBiLdKknH+8GZXenGdtY=";
27 };
28
29 postPatch = ''
30 substituteInPlace tox.ini \
31 --replace "--cov=versioningit" "" \
32 --replace "--cov-config=tox.ini" "" \
33 --replace "--no-cov-on-fail" ""
34 '';
35
36 propagatedBuildInputs = [
37 packaging
38 setuptools
39 ] ++ lib.optionals (pythonOlder "3.10") [
40 importlib-metadata
41 ] ++ lib.optionals (pythonOlder "3.11") [
42 tomli
43 ];
44
45 checkInputs = [
46 pytestCheckHook
47 build
48 pydantic
49 pytest-mock
50 git
51 mercurial
52 ];
53
54 disabledTests = [
55 # wants to write to the Nix store
56 "test_editable_mode"
57 ];
58
59 pythonImportsCheck = [
60 "versioningit"
61 ];
62
63 meta = with lib; {
64 description = "setuptools plugin for determining package version from VCS";
65 homepage = "https://github.com/jwodder/versioningit";
66 changelog = "https://versioningit.readthedocs.io/en/latest/changelog.html";
67 license = licenses.mit;
68 maintainers = with maintainers; [ DeeUnderscore ];
69 };
70}