2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, pythonOlder
|
2023-11-16 04:20:00 +00:00
|
|
|
, setuptools-scm
|
|
|
|
, git
|
2022-10-21 18:38:19 +00:00
|
|
|
, sphinx
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, cython
|
|
|
|
, gcc
|
|
|
|
, graphviz
|
2022-10-21 18:38:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sphinx-automodapi";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.16.0";
|
|
|
|
pyproject = true;
|
2022-10-21 18:38:19 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "astropy";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-ecOwBtJBkGsBShMG5fK22V1EHLe6pCmOdHPrS/k6rno=";
|
|
|
|
leaveDotGit = true;
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
git
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
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 = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
substituteInPlace sphinx_automodapi/tests/{helpers,test_cases}.py \
|
|
|
|
--replace ", None)" ", (None, '${testInventory}'))"
|
2022-10-21 18:38:19 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-21 18:38:19 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|