%global srcname sphinx-automodapi Name: python-%{srcname} Version: 0.16.0 Release: %autorelease Summary: Sphinx extension for auto-generating modules API documentation License: BSD-3-Clause URL: https://github.com/astropy/sphinx-automodapi Source: %{pypi_source} BuildArch: noarch BuildRequires: gcc BuildRequires: graphviz BuildRequires: python3-cython BuildRequires: python3-devel BuildRequires: python3-docs BuildRequires: sed %global _description %{expand: This is a Sphinx extension to automatically generate API pages for whole modules. It was originally developed for the Astropy project but is now available as a standalone package since it can be used for any other package.} %description %_description %package -n python3-%{srcname} Summary: %{summary} Suggests: %{name}-doc = %{version}-%{release} %description -n python3-%{srcname} %_description %pyproject_extras_subpkg -n python3-sphinx-automodapi rtd %package doc Summary: Documentation for %{name} %description doc This package contains additional documentation for %{name}. %prep %autosetup -p1 -n %{srcname}-%{version} # Drop no longer needed version pin sed -i '/sphinx<7/d' setup.cfg # Use local intersphinx inventory sed \ -e "s|\('https://docs\.python\.org/3/', \)None|\1'%{_docdir}/python3-docs/html/objects.inv'|" \ -i sphinx_automodapi/tests/{helpers.py,test_cases.py} %generate_buildrequires %pyproject_buildrequires -x rtd,test -t %build %pyproject_wheel # The docs use the module itself so we need to set PYTHONPATH accordingly PYTHONPATH=. sphinx-build-3 docs html rm -r html/{.buildinfo,.doctrees} %install %pyproject_install %pyproject_save_files sphinx_automodapi %check %tox %files -n python3-%{srcname} -f %{pyproject_files} %doc README.rst CHANGES.rst %files doc %license LICENSE.rst %doc html %changelog %autochangelog