1{ lib
2, buildPythonPackage
3, python
4, pythonOlder
5, fetchFromGitHub
6, poetry-core
7, beautifulsoup4
8, lxml
9, jinja2
10, dataclasses
11, pytestCheckHook
12}:
13
14buildPythonPackage rec {
15 pname = "reqif";
16 version = "0.0.8";
17 format = "pyproject";
18
19 src = fetchFromGitHub {
20 owner = "strictdoc-project";
21 repo = pname;
22 rev = version;
23 sha256 = "sha256-PtzRJUvv+Oee08+sdakFviKIhwfLngyal1WSWDtMELg=";
24 };
25
26 postPatch = ''
27 substituteInPlace ./tests/unit/conftest.py --replace \
28 "os.path.abspath(os.path.join(__file__, \"../../../../reqif\"))" \
29 "\"${placeholder "out"}/${python.sitePackages}/reqif\""
30 substituteInPlace pyproject.toml --replace "^" ">="
31 substituteInPlace requirements.txt --replace "==" ">="
32 '';
33
34 nativeBuildInputs = [
35 poetry-core
36 ];
37
38 propagatedBuildInputs = [
39 beautifulsoup4
40 lxml
41 jinja2
42 ] ++ lib.optionals (pythonOlder "3.7") [
43 dataclasses
44 ];
45
46 pythonImportsCheck = [
47 "reqif"
48 ];
49
50 checkInputs = [
51 pytestCheckHook
52 ];
53
54 meta = with lib; {
55 description = "Python library for ReqIF format";
56 homepage = "https://github.com/strictdoc-project/reqif";
57 license = licenses.asl20;
58 maintainers = with maintainers; [ yuu ];
59 };
60}