summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/spdx-tools/default.nix
blob: 08458f9bb14e8608addbf534a51ac2d56d83399d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
  lib,
  beartype,
  buildPythonPackage,
  click,
  fetchFromGitHub,
  fetchpatch,
  license-expression,
  ply,
  pytestCheckHook,
  pyyaml,
  rdflib,
  semantic-version,
  setuptools,
  setuptools-scm,
  uritools,
  xmltodict,
}:

buildPythonPackage rec {
  pname = "spdx-tools";
  version = "0.8.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "spdx";
    repo = "tools-python";
    tag = "v${version}";
    hash = "sha256-r7+RYGoq3LJYN1jYfwzb1r3fc/kL+CPd4pmGATFq8Pw=";
  };

  patches = [
    # https://github.com/spdx/tools-python/issues/844
    (fetchpatch {
      name = "beartype-0.20-compat.patch";
      url = "https://github.com/spdx/tools-python/pull/841/commits/3b13bd5af36a2b78f5c87fdbadc3f2601d2dcd8d.patch";
      hash = "sha256-8sQNGRss4R1olsw+xGps3NICyimBxKv47TaSrCcnVhA=";
    })
  ];

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [
    beartype
    click
    license-expression
    ply
    pyyaml
    rdflib
    semantic-version
    uritools
    xmltodict
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "spdx_tools.spdx" ];

  disabledTestPaths = [
    # Test depends on the currently not packaged pyshacl module
    "tests/spdx3/validation/json_ld/test_shacl_validation.py"
  ];

  disabledTests = [
    # Missing files
    "test_spdx2_convert_to_spdx3"
    "test_json_writer"
  ];

  meta = {
    description = "SPDX parser and tools";
    homepage = "https://github.com/spdx/tools-python";
    changelog = "https://github.com/spdx/tools-python/blob/v${version}/CHANGELOG.md";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ fab ];
  };
}