From 7b560da1dc984749e111251da401b6b395b2ca66 Mon Sep 17 00:00:00 2001 From: yuu Date: Tue, 12 Apr 2022 02:33:57 -0300 Subject: strictdoc: init at 0.0.26 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sandro Jäckel Co-authored-by: Jonathan Ringer --- .../engineering/strictdoc/conftest.py.patch | 15 ++++ .../science/engineering/strictdoc/default.nix | 100 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 117 insertions(+) create mode 100644 pkgs/applications/science/engineering/strictdoc/conftest.py.patch create mode 100644 pkgs/applications/science/engineering/strictdoc/default.nix diff --git a/pkgs/applications/science/engineering/strictdoc/conftest.py.patch b/pkgs/applications/science/engineering/strictdoc/conftest.py.patch new file mode 100644 index 0000000000000..2fadf242b7a37 --- /dev/null +++ b/pkgs/applications/science/engineering/strictdoc/conftest.py.patch @@ -0,0 +1,15 @@ +diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py +index 932747c..9b3d6ac 100644 +--- a/tests/unit/conftest.py ++++ b/tests/unit/conftest.py +@@ -1,9 +1,7 @@ + import os + import sys + +-STRICTDOC_ROOT_PATH = os.path.abspath( +- os.path.join(__file__, "../../../../strictdoc") +-) ++STRICTDOC_ROOT_PATH = "@strictdoc_root_path@" + assert os.path.exists(STRICTDOC_ROOT_PATH), "does not exist: {}".format( + STRICTDOC_ROOT_PATH + ) diff --git a/pkgs/applications/science/engineering/strictdoc/default.nix b/pkgs/applications/science/engineering/strictdoc/default.nix new file mode 100644 index 0000000000000..3fc61b8451567 --- /dev/null +++ b/pkgs/applications/science/engineering/strictdoc/default.nix @@ -0,0 +1,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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5f1a48ba964e..24dd3606db7bc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34057,6 +34057,8 @@ with pkgs; jflap = callPackage ../applications/science/engineering/jflap { }; + strictdoc = python3.pkgs.callPackage ../applications/science/engineering/strictdoc { }; + ### SCIENCE / ELECTRONICS adms = callPackage ../applications/science/electronics/adms { }; -- cgit 1.4.1