nav: init at 1.2.1 (#356071)
[NixPkgs.git] / pkgs / development / python-modules / python-creole / default.nix
blob53f77d388f5f4b16ffda6bc2420c17d6e96e200a
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch,
6   runtimeShell,
8   # build
9   poetry-core,
11   # propagates
12   docutils,
14   # tests
15   pytestCheckHook,
16   readme-renderer,
17   textile,
20 buildPythonPackage rec {
21   pname = "python-creole";
22   version = "1.4.10";
23   format = "pyproject";
25   src = fetchFromGitHub {
26     owner = "jedie";
27     repo = "python-creole";
28     rev = "refs/tags/v${version}";
29     hash = "sha256-8pXOnLNjhIv0d+BqjW8wlb6BT6CmFHSsxn5wLOv3LBQ=";
30   };
32   patches = [
33     # https://github.com/jedie/python-creole/pull/77
34     (fetchpatch {
35       name = "replace-poetry-with-poetry-core.patch";
36       url = "https://github.com/jedie/python-creole/commit/bfc46730ab4a189f3142246cead8d26005a28671.patch";
37       hash = "sha256-WtoEQyu/154Cfj6eSnNA+t37+o7Ij328QGMKxwcLg5k=";
38     })
39   ];
41   nativeBuildInputs = [ poetry-core ];
43   postPatch = ''
44     substituteInPlace Makefile \
45       --replace "/bin/bash" "${runtimeShell}"
47     sed -i "/-cov/d" pytest.ini
48   '';
50   propagatedBuildInputs = [ docutils ];
52   pythonImportsCheck = [ "creole" ];
54   nativeCheckInputs = [
55     pytestCheckHook
56     readme-renderer
57     textile
58   ];
60   preCheck = ''
61     export PATH=$out/bin:$PATH
62   '';
64   disabledTests = [
65     # macro didn't expect argument
66     "test_macro_wrong_arguments_quite"
67     "test_macro_wrong_arguments_with_error_report"
68     # rendering mismatches, likely docutils version mismatch
69     "test_headlines1"
70     "test_simple_table"
71   ];
73   disabledTestPaths = [
74     # requires poetry
75     "creole/tests/test_Makefile.py"
76     # requires poetry_publish
77     "creole/publish.py"
78     "creole/tests/test_project_setup.py"
79     # rendering differencenes, likely docutils version mismatch
80     "creole/tests/test_cross_compare_rest.py"
81     "creole/tests/test_rest2html.py"
82   ];
84   pytestFlagsArray = [
85     # fixture mismatch after docutils update
86     "--deselect=creole/rest_tools/clean_writer.py::creole.rest_tools.clean_writer.rest2html"
87     "--deselect=creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link"
88     "--deselect=creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_with_at_sign"
89     "--deselect=creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_with_unknown_protocol"
90     "--deselect=creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_without_title"
91   ];
93   meta = with lib; {
94     description = "Creole markup tools written in Python";
95     homepage = "https://github.com/jedie/python-creole";
96     changelog = "https://github.com/jedie/python-creole/releases/tag/v${version}";
97     license = licenses.gpl3Plus;
98     maintainers = with maintainers; [ hexa ];
99   };