summary refs log tree commit diff
path: root/pkgs/development/python-modules/reqif/default.nix
blob: 1e5ecc718d9d285a169c3db740aa9a6187714813 (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
{ lib
, buildPythonPackage
, python
, fetchFromGitHub
, poetry-core
, beautifulsoup4
, lxml
, jinja2
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "reqif";
  version = "0.0.8";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "strictdoc-project";
    repo = pname;
    rev = version;
    sha256 = "sha256-PtzRJUvv+Oee08+sdakFviKIhwfLngyal1WSWDtMELg=";
  };

  postPatch = ''
    substituteInPlace ./tests/unit/conftest.py --replace \
       "os.path.abspath(os.path.join(__file__, \"../../../../reqif\"))" \
      "\"${placeholder "out"}/${python.sitePackages}/reqif\""
    substituteInPlace pyproject.toml --replace "^" ">="
    substituteInPlace requirements.txt --replace "==" ">="
  '';

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    beautifulsoup4
    lxml
    jinja2
  ];

  pythonImportsCheck = [
    "reqif"
  ];

  checkInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Python library for ReqIF format";
    homepage = "https://github.com/strictdoc-project/reqif";
    license = licenses.asl20;
    maintainers = with maintainers; [ yuu ];
  };
}