1{ lib
2, buildPythonPackage
3, cython
4, fetchFromGitHub
5, fetchurl
6, gcc
7, graphviz
8, pytestCheckHook
9, pythonOlder
10, sphinx
11}:
12
13buildPythonPackage rec {
14 pname = "sphinx-automodapi";
15 version = "0.14.1";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "astropy";
22 repo = pname;
23 rev = "v${version}";
24 hash = "sha256-olD9LIyFCNEu287wQIRqoabfrdcdyZpNc69jq/e1304=";
25 };
26
27 propagatedBuildInputs = [ sphinx ];
28
29 # https://github.com/astropy/sphinx-automodapi/issues/155
30 testInventory = fetchurl {
31 # Originally: https://docs.python.org/3/objects.inv
32 url = "https://web.archive.org/web/20221007193144/https://docs.python.org/3/objects.inv";
33 hash = "sha256-1cbUmdJJSoifkiIYa70SxnLsaK3F2gvnTEWo9vo/6rY=";
34 };
35
36 postPatch = ''
37 substituteInPlace "sphinx_automodapi/tests/helpers.py" \
38 --replace '[0]), None)' "[0]), (None, '${testInventory}'))"
39 '';
40
41 checkInputs = [
42 pytestCheckHook
43 cython
44 gcc
45 graphviz
46 ];
47
48 pythonImportsCheck = [ "sphinx_automodapi" ];
49
50 meta = with lib; {
51 description = "Sphinx extension for generating API documentation";
52 homepage = "https://github.com/astropy/sphinx-automodapi";
53 license = licenses.bsd3;
54 maintainers = with maintainers; [ lovesegfault ];
55 };
56}