1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pytest-asyncio,
7 pythonAtLeast,
8 pythonOlder,
9 defusedxml,
10 setuptools,
11 sphinx,
12 typing-extensions,
13 unidecode,
14}:
15
16buildPythonPackage rec {
17 pname = "uqbar";
18 version = "0.9.5";
19 pyproject = true;
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-MHSnuPiJu2p3NiG/bV6qFUO90xQEFcyQrcxMY0hw8E8=";
26 };
27
28 postPatch = ''
29 sed -i pyproject.toml \
30 -e '/"black"/d' \
31 -e "/--cov/d"
32 '';
33
34 nativeBuildInputs = [ setuptools ];
35
36 propagatedBuildInputs = [
37 unidecode
38 sphinx
39 ];
40
41 nativeCheckInputs = [
42 pytestCheckHook
43 pytest-asyncio
44 ];
45
46 checkInputs = [
47 defusedxml
48 typing-extensions
49 ];
50
51 disabledTests = [
52 # UnboundLocalError: local variable 'output_path' referenced before assignment
53 "test_01"
54 # AssertionError: assert False
55 "test_sphinx_book_html_cached"
56 # FileNotFoundError: [Errno 2] No such file or directory: 'unflatten'
57 "test_sphinx_style_html"
58 # assert not ["\x1b[91mWARNING: dot command 'dot' cannot be run (needed for
59 # graphviz output), check the graphviz_dot setting\x1b[39;49;00m"]
60 "test_sphinx_style_latex"
61 ]
62 ++ lib.optional (pythonAtLeast "3.11") [
63 # assert not '\x1b[91m/build/uqbar-0.7.0/tests/fake_package/enums.py:docstring
64 "test_sphinx_style"
65 ]
66 ++ lib.optional (pythonAtLeast "3.12") [
67 # https://github.com/josiah-wolf-oberholtzer/uqbar/issues/93
68 "objects.get_vars"
69 ];
70
71 pythonImportsCheck = [ "uqbar" ];
72
73 meta = with lib; {
74 description = "Tools for creating Sphinx and Graphviz documentation";
75 homepage = "https://github.com/josiah-wolf-oberholtzer/uqbar";
76 changelog = "https://github.com/josiah-wolf-oberholtzer/uqbar/releases/tag/v${version}";
77 license = licenses.mit;
78 maintainers = with maintainers; [ davisrichard437 ];
79 };
80}