1{
2 lib,
3 buildPythonPackage,
4 click,
5 fetchPypi,
6 git, # shells out to git
7 hatchling,
8 importlib-resources,
9 incremental,
10 jinja2,
11 mock,
12 pytestCheckHook,
13 pythonOlder,
14 tomli,
15 twisted,
16}:
17
18buildPythonPackage rec {
19 pname = "towncrier";
20 version = "25.8.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-7vFtKfgxrVers64yoFZXOYZiGfHr+90pfTKJTrmUDrE=";
28 };
29
30 build-system = [ hatchling ];
31
32 dependencies = [
33 click
34 incremental
35 jinja2
36 ]
37 ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ]
38 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
39
40 preCheck = ''
41 export PATH=$out/bin:$PATH
42 '';
43
44 nativeCheckInputs = [
45 git
46 mock
47 twisted
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "towncrier" ];
52
53 meta = with lib; {
54 description = "Utility to produce useful, summarised news files";
55 homepage = "https://github.com/twisted/towncrier/";
56 changelog = "https://github.com/twisted/towncrier/blob/${version}/NEWS.rst";
57 license = licenses.mit;
58 maintainers = [ ];
59 mainProgram = "towncrier";
60 };
61}