depot/third_party/nixpkgs/pkgs/development/python-modules/sphinx-automodapi/default.nix
Default email a0cb138ada Project import generated by Copybara.
GitOrigin-RevId: a100acd7bbf105915b0004427802286c37738fef
2023-02-02 18:25:31 +00:00

59 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, cython
, fetchFromGitHub
, fetchurl
, gcc
, graphviz
, pytestCheckHook
, pythonOlder
, sphinx
}:
buildPythonPackage rec {
pname = "sphinx-automodapi";
version = "0.14.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "astropy";
repo = pname;
rev = "v${version}";
hash = "sha256-olD9LIyFCNEu287wQIRqoabfrdcdyZpNc69jq/e1304=";
};
propagatedBuildInputs = [ sphinx ];
# https://github.com/astropy/sphinx-automodapi/issues/155
testInventory = fetchurl {
# Originally: https://docs.python.org/3/objects.inv
url = "https://web.archive.org/web/20221007193144/https://docs.python.org/3/objects.inv";
hash = "sha256-1cbUmdJJSoifkiIYa70SxnLsaK3F2gvnTEWo9vo/6rY=";
};
postPatch = ''
substituteInPlace "sphinx_automodapi/tests/helpers.py" \
--replace '[0]), None)' "[0]), (None, '${testInventory}'))"
substituteInPlace "sphinx_automodapi/tests/test_cases.py" \
--replace '[0]), None)' "[0]), (None, '${testInventory}'))"
'';
nativeCheckInputs = [
pytestCheckHook
cython
gcc
graphviz
];
pythonImportsCheck = [ "sphinx_automodapi" ];
meta = with lib; {
description = "Sphinx extension for generating API documentation";
homepage = "https://github.com/astropy/sphinx-automodapi";
license = licenses.bsd3;
maintainers = with maintainers; [ lovesegfault ];
};
}