%global srcname sphinx-automodapi Name: python-%{srcname} Version: 0.16.0 Release: 1%{?dist} Summary: Sphinx extension to automatically generate API pages for whole modules License: BSD-3-Clause URL: https://github.com/astropy/sphinx-automodapi Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # intersphinx_mapping file needed for tests Source1: https://docs.python.org/3/objects.inv # This patch will allow us to build the automodapi docs using automodapi # https://github.com/astropy/sphinx-automodapi/issues/160#issuecomment-1466944180 Patch0: python-sphinx-automodapi-build-docs-oos.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: sed # needed to generate documentation BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinx-rtd-theme) # needed for check BuildRequires: python3dist(cython) BuildRequires: python3dist(pytest) BuildRequires: graphviz BuildRequires: gcc %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. The latest documentation can be found here: https://sphinx-automodapi.readthedocs.io/en/latest/. } %description %_description %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires -t %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %prep %autosetup -p 1 -n %{srcname}-%{version} # modify tests to look locally for intersphinx_mapping file rather than the internets # https://github.com/astropy/sphinx-automodapi/issues/155#issuecomment-1271943999 sed -i 's|None)|(None, \x27%{SOURCE1}\x27))|' ./sphinx_automodapi/tests/{helpers.py,test_cases.py} %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel # generate html docs sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.doctrees %install %pyproject_install %pyproject_save_files sphinx_automodapi %check %tox %files -n python3-%{srcname} -f %{pyproject_files} %doc html README.rst CHANGES.rst %license LICENSE.rst %changelog * Tue Oct 03 2023 Andrew Bauer - 0.16.0-1 - initial specfile - 0.16.0 release