about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/python-creole/default.nix
blob: 52d13d452affc23b2161b566042640e53440b441 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, runtimeShell

# build
, poetry-core

# propagates
, docutils

# tests
, pytestCheckHook
, readme_renderer
, textile
}:

buildPythonPackage rec {
  pname = "python-creole";
  version = "1.4.10";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "jedie";
    repo = "python-creole";
    rev = "refs/tags/v${version}";
    hash = "sha256-8pXOnLNjhIv0d+BqjW8wlb6BT6CmFHSsxn5wLOv3LBQ=";
  };

  patches = [
    # https://github.com/jedie/python-creole/pull/77
    (fetchpatch {
      name = "replace-poetry-with-poetry-core.patch";
      url = "https://github.com/jedie/python-creole/commit/bfc46730ab4a189f3142246cead8d26005a28671.patch";
      hash = "sha256-WtoEQyu/154Cfj6eSnNA+t37+o7Ij328QGMKxwcLg5k=";
    })
  ];

  nativeBuildInputs = [
    poetry-core
  ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace "/bin/bash" "${runtimeShell}"

    sed -i "/-cov/d" pytest.ini
  '';

  propagatedBuildInputs = [
    docutils
  ];

  pythonImportsCheck = [
    "creole"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    readme_renderer
    textile
  ];

  preCheck = ''
    export PATH=$out/bin:$PATH
  '';

  disabledTests = [
    # macro didn't expect argument
    "test_macro_wrong_arguments_quite"
    "test_macro_wrong_arguments_with_error_report"
    # rendering mismatches, likely docutils version mismatch
    "test_headlines1"
    "test_simple_table"
  ];

  disabledTestPaths = [
    # requires poetry
    "creole/tests/test_Makefile.py"
    # requires poetry_publish
    "creole/publish.py"
    "creole/tests/test_project_setup.py"
    # rendering differencenes, likely docutils version mismatch
    "creole/tests/test_cross_compare_rest.py"
    "creole/tests/test_rest2html.py"
  ];

  meta = with lib; {
    description = "Creole markup tools written in Python";
    homepage = "https://github.com/jedie/python-creole";
    changelog = "https://github.com/jedie/python-creole/releases/tag/v${version}";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ hexa ];
  };
}