1{
2 buildPythonPackage,
3 click,
4 fetchFromGitHub,
5 lib,
6 pythonOlder,
7 setuptools,
8 tomli,
9 twisted,
10}:
11
12let
13 incremental = buildPythonPackage rec {
14 pname = "incremental";
15 version = "24.7.2";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "twisted";
20 repo = "incremental";
21 tag = "incremental-${version}";
22 hash = "sha256-5MlIKUaBUwLTet23Rjd2Opf5e54LcHuZDowcGon0lOE=";
23 };
24
25 # From upstream's pyproject.toml:
26 # "Keep this aligned with the project dependencies."
27 build-system = dependencies;
28
29 dependencies = [ setuptools ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
30
31 optional-dependencies = {
32 scripts = [ click ];
33 };
34
35 # escape infinite recursion with twisted
36 doCheck = false;
37
38 nativeCheckInputs = [ twisted ];
39
40 checkPhase = ''
41 trial incremental
42 '';
43
44 passthru.tests = {
45 check = incremental.overridePythonAttrs (_: {
46 doCheck = true;
47 });
48 };
49
50 pythonImportsCheck = [ "incremental" ];
51
52 meta = {
53 changelog = "https://github.com/twisted/incremental/blob/${src.rev}/NEWS.rst";
54 homepage = "https://github.com/twisted/incremental";
55 description = "Small library that versions your Python projects";
56 license = lib.licenses.mit;
57 maintainers = with lib.maintainers; [ dotlambda ];
58 };
59 };
60in
61incremental