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