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 = "24.8.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-ATQj7n7tECsvOTwofSLZX2bxo+oQpLqoLSmAAafxivM=";
28 };
29
30 build-system = [ hatchling ];
31
32 dependencies =
33 [
34 click
35 incremental
36 jinja2
37 ]
38 ++ lib.optionals (pythonOlder "3.10") [ importlib-resources ]
39 ++ lib.optionals (pythonOlder "3.11") [ tomli ];
40
41 preCheck = ''
42 export PATH=$out/bin:$PATH
43 '';
44
45 nativeCheckInputs = [
46 git
47 mock
48 twisted
49 pytestCheckHook
50 ];
51
52 pythonImportsCheck = [ "towncrier" ];
53
54 meta = with lib; {
55 description = "Utility to produce useful, summarised news files";
56 homepage = "https://github.com/twisted/towncrier/";
57 changelog = "https://github.com/twisted/towncrier/blob/${version}/NEWS.rst";
58 license = licenses.mit;
59 maintainers = [ ];
60 mainProgram = "towncrier";
61 };
62}