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