summary refs log tree commit diff
path: root/pkgs/applications/science/engineering/strictdoc/default.nix
blob: 3fc61b8451567aec3f90b270d7a17ce7b2c32455 (plain) (blame)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{ lib
, stdenv
, buildPythonApplication
, fetchFromGitHub
, python3
, pythonOlder
, html5lib
, invoke
, openpyxl
, poetry-core
, tidylib
, beautifulsoup4
, dataclasses
, datauri
, docutils
, jinja2
, lxml
, markupsafe
, pygments
, reqif
, setuptools
, textx
, xlrd
, XlsxWriter
, pytestCheckHook
}:

buildPythonApplication rec {
  pname = "strictdoc";
  version = "0.0.26";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "strictdoc-project";
    repo = pname;
    rev = version;
    sha256 = "sha256-SMAwji75AjW8CzXRKBDF+fR/a5++GhgIvkcuD+a/vp4=";
  };

  patches = [
    ./conftest.py.patch
  ];

  postPatch = ''
    substituteInPlace ./tests/unit/conftest.py \
      --replace @strictdoc_root_path@ "${placeholder "out"}/${python3.sitePackages}/strictdoc"

    substituteInPlace requirements.txt \
      --replace "jinja2 >= 2.11.2, <3.0" "jinja2 >= 2.11.2" \
      --replace "reqif >= 0.0.18, == 0.*" "reqif>=0.0.8" \
      --replace "==" ">=" \
      --replace "~=" ">="
  '';

  nativeBuildInputs = [
    html5lib
    invoke
    openpyxl
    poetry-core
    tidylib
  ];

  propagatedBuildInputs = [
    beautifulsoup4
    datauri
    docutils
    jinja2
    lxml
    markupsafe
    pygments
    reqif
    setuptools
    textx
    xlrd
    XlsxWriter
  ] ++ lib.optionals (pythonOlder "3.7") [
    dataclasses
  ];

  checkInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck = [
    "strictdoc"
  ];

  disabledTests = [
    # fixture 'fs' not found
    "test_001_load_from_files"
  ];

  meta = with lib; {
    description = "Software requirements specification tool";
    homepage = "https://github.com/strictdoc-project/strictdoc";
    changelog = "https://github.com/strictdoc-project/strictdoc/releases";
    license = licenses.asl20;
    maintainers = with maintainers; [ yuu ];
  };
}