sphinx-automodapi: fix import check, tests, use pyproject

This commit is contained in:
Madoura 2023-10-23 07:53:48 -05:00
parent d4a8b35d86
commit bd1fbd67f2
No known key found for this signature in database
GPG key ID: 1B9BB76A2B71922D

View file

@ -1,29 +1,36 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, cython
, fetchFromGitHub , fetchFromGitHub
, fetchurl , fetchurl
, pythonOlder
, setuptools-scm
, git
, sphinx
, pytestCheckHook
, cython
, gcc , gcc
, graphviz , graphviz
, pytestCheckHook
, pythonOlder
, sphinx
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "sphinx-automodapi"; pname = "sphinx-automodapi";
version = "0.16.0"; version = "0.16.0";
format = "setuptools"; pyproject = true;
disabled = pythonOlder "3.7"; disabled = pythonOlder "3.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "astropy"; owner = "astropy";
repo = pname; repo = pname;
rev = "refs/tags/v${version}"; rev = "v${version}";
hash = "sha256-7/b3PlgoqXyzmj4KDoHJf5gd3SUSiyhkpcDWl3u+0Bs="; hash = "sha256-ecOwBtJBkGsBShMG5fK22V1EHLe6pCmOdHPrS/k6rno=";
leaveDotGit = true;
}; };
nativeBuildInputs = [
setuptools-scm
git
];
propagatedBuildInputs = [ sphinx ]; propagatedBuildInputs = [ sphinx ];
# https://github.com/astropy/sphinx-automodapi/issues/155 # https://github.com/astropy/sphinx-automodapi/issues/155
@ -34,11 +41,8 @@ buildPythonPackage rec {
}; };
postPatch = '' postPatch = ''
substituteInPlace "sphinx_automodapi/tests/helpers.py" \ substituteInPlace sphinx_automodapi/tests/{helpers,test_cases}.py \
--replace '[0]), None)' "[0]), (None, '${testInventory}'))" --replace ", None)" ", (None, '${testInventory}'))"
substituteInPlace "sphinx_automodapi/tests/test_cases.py" \
--replace '[0]), None)' "[0]), (None, '${testInventory}'))"
''; '';
nativeCheckInputs = [ nativeCheckInputs = [