1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6
7 # dependencies
8 attrs,
9 binaryornot,
10 boolean-py,
11 debian,
12 jinja2,
13 license-expression,
14 tomlkit,
15
16 # test dependencies
17 freezegun,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "reuse";
23 version = "4.0.3";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "fsfe";
28 repo = "reuse-tool";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-oKtQBT8tuAk4S/Sygp4qxLk4ADWDTG0MbVaL5O2qsuA=";
31 };
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
36 attrs
37 binaryornot
38 boolean-py
39 debian
40 jinja2
41 license-expression
42 tomlkit
43 ];
44
45 nativeCheckInputs = [ pytestCheckHook freezegun ];
46
47 disabledTestPaths = [
48 # pytest wants to execute the actual source files for some reason, which fails with ImportPathMismatchError()
49 "src/reuse"
50 ];
51
52 pythonImportsCheck = [ "reuse" ];
53
54 meta = with lib; {
55 description = "Tool for compliance with the REUSE Initiative recommendations";
56 homepage = "https://github.com/fsfe/reuse-tool";
57 changelog = "https://github.com/fsfe/reuse-tool/blob/v${version}/CHANGELOG.md";
58 license = with licenses; [
59 asl20
60 cc-by-sa-40
61 cc0
62 gpl3Plus
63 ];
64 maintainers = with maintainers; [
65 FlorianFranzen
66 Luflosi
67 ];
68 mainProgram = "reuse";
69 };
70}