1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 fetchpatch, 6 runtimeShell, 7 8 # build 9 poetry-core, 10 11 # propagates 12 docutils, 13 14 # tests 15 pytestCheckHook, 16 readme-renderer, 17 textile, 18}: 19 20buildPythonPackage rec { 21 pname = "python-creole"; 22 version = "1.4.10"; 23 format = "pyproject"; 24 25 src = fetchFromGitHub { 26 owner = "jedie"; 27 repo = "python-creole"; 28 tag = "v${version}"; 29 hash = "sha256-8pXOnLNjhIv0d+BqjW8wlb6BT6CmFHSsxn5wLOv3LBQ="; 30 }; 31 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 ]; 40 41 nativeBuildInputs = [ poetry-core ]; 42 43 postPatch = '' 44 substituteInPlace Makefile \ 45 --replace "/bin/bash" "${runtimeShell}" 46 47 sed -i "/-cov/d" pytest.ini 48 ''; 49 50 propagatedBuildInputs = [ docutils ]; 51 52 pythonImportsCheck = [ "creole" ]; 53 54 nativeCheckInputs = [ 55 pytestCheckHook 56 readme-renderer 57 textile 58 ]; 59 60 preCheck = '' 61 export PATH=$out/bin:$PATH 62 ''; 63 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 ]; 72 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 # fixture mismatch after docutils update 83 "creole/rest_tools/clean_writer.py::creole.rest_tools.clean_writer.rest2html" 84 "creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link" 85 "creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_with_at_sign" 86 "creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_with_unknown_protocol" 87 "creole/tests/test_cross_compare_all.py::CrossCompareTests::test_link_without_title" 88 ]; 89 90 meta = with lib; { 91 description = "Creole markup tools written in Python"; 92 homepage = "https://github.com/jedie/python-creole"; 93 changelog = "https://github.com/jedie/python-creole/releases/tag/v${version}"; 94 license = licenses.gpl3Plus; 95 maintainers = with maintainers; [ hexa ]; 96 }; 97}