1{ lib
2, buildPythonPackage
3, fetchPypi
4, fetchpatch
5, six
6, pyyaml
7, rdflib
8, ply
9, xmltodict
10, pytestCheckHook
11, pythonAtLeast
12}:
13buildPythonPackage rec {
14 pname = "spdx-tools";
15 version = "0.6.1";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "9a1aaae051771e865705dd2fd374c3f73d0ad595c1056548466997551cbd7a81";
20 };
21
22 patches = lib.optionals (pythonAtLeast "3.9") [
23 # https://github.com/spdx/tools-python/pull/159
24 # fixes tests on Python 3.9
25 (fetchpatch {
26 name = "drop-encoding-argument.patch";
27 url = "https://github.com/spdx/tools-python/commit/6c8b9a852f8a787122c0e2492126ee8aa52acff0.patch";
28 sha256 = "RhvLhexsQRjqYqJg10SAM53RsOW+R93G+mns8C9g5E8=";
29 })
30 ];
31
32 propagatedBuildInputs = [
33 six
34 pyyaml
35 rdflib
36 ply
37 xmltodict
38 ];
39
40 checkInputs = [
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "spdx"
46 ];
47
48 meta = with lib; {
49 description = "SPDX parser and tools";
50 homepage = "https://github.com/spdx/tools-python";
51 license = licenses.asl20;
52 maintainers = teams.determinatesystems.members;
53 };
54}