- Create doc subpackage with _multibuild to move

python3-sphnix-autodoc-typehints build requirement out of ring1

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rdflib?expand=0&rev=64
This commit is contained in:
Daniel Garcia 2024-07-03 11:45:53 +00:00 committed by Git OBS Bridge
parent 5e0cc5dda4
commit eaad9a3601
3 changed files with 40 additions and 9 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>doc</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jul 3 11:44:54 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Create doc subpackage with _multibuild to move
python3-sphnix-autodoc-typehints build requirement out of ring1
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 27 06:23:55 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com> Tue Feb 27 06:23:55 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@ -16,8 +16,17 @@
# #
# Tests don't work and cause a dependency loop with python-SPARQLWrapper
%bcond_with tests %bcond_with tests
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "doc"
%bcond_without doc
%bcond_with tests
%else
%bcond_with doc
%bcond_with tests
%endif
Name: python-rdflib Name: python-rdflib
Version: 7.0.0 Version: 7.0.0
Release: 0 Release: 0
@ -29,7 +38,7 @@ BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module html5lib} BuildRequires: %{python_module html5lib}
BuildRequires: %{python_module isodate} BuildRequires: %{python_module isodate}
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module poetry} BuildRequires: %{python_module poetry-core}
BuildRequires: %{python_module pyparsing} BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: %{python_module xml} BuildRequires: %{python_module xml}
@ -37,7 +46,6 @@ BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx BuildRequires: python3-Sphinx
BuildRequires: python3-myst-parser BuildRequires: python3-myst-parser
BuildRequires: python3-sphinx-autodoc-typehints
BuildRequires: python3-sphinxcontrib-apidoc BuildRequires: python3-sphinxcontrib-apidoc
Requires: python-html5lib Requires: python-html5lib
Requires: python-isodate Requires: python-isodate
@ -50,6 +58,9 @@ BuildRequires: %{python_module SPARQLWrapper}
BuildRequires: %{python_module flake8} BuildRequires: %{python_module flake8}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
%endif %endif
%if %{with doc}
BuildRequires: python3-sphinx-autodoc-typehints
%endif
%python_subpackages %python_subpackages
%description %description
@ -61,6 +72,7 @@ The library also contains both in-memory and persistent Graph backends.
%package -n %{name}-doc %package -n %{name}-doc
Summary: A Python library for working with RDF Summary: A Python library for working with RDF
Provides: %{python_module rdflib-doc = %{version}} Provides: %{python_module rdflib-doc = %{version}}
BuildRequires: %{python_module rdflib = %{version}}
%description -n %{name}-doc %description -n %{name}-doc
RDFLib is a Python library for working with RDF, a simple yet powerful RDFLib is a Python library for working with RDF, a simple yet powerful
@ -73,27 +85,33 @@ The library also contains both in-memory and persistent Graph backends.
# remove unwanted shebang # remove unwanted shebang
find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }' find rdflib -name "*.py" | xargs sed -i '1 { /^#!/ d }'
%if %{without doc}
%build %build
%pyproject_wheel %pyproject_wheel
%endif
%install %install
%pyproject_install
%if %{with doc}
# Build the docs, we need the module queryable # Build the docs, we need the module queryable
pushd docs pushd docs
PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html PYTHONPATH=%{buildroot}%{python3_sitelib} %make_build html
# Remove hidden file # Remove hidden file
rm -r _build/html/.buildinfo rm -r _build/html/.buildinfo
popd popd
%fdupes docs/_build/html
exit 1
%else
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/rdfs2dot %python_clone -a %{buildroot}%{_bindir}/rdfs2dot
%python_clone -a %{buildroot}%{_bindir}/rdfpipe %python_clone -a %{buildroot}%{_bindir}/rdfpipe
%python_clone -a %{buildroot}%{_bindir}/rdfgraphisomorphism %python_clone -a %{buildroot}%{_bindir}/rdfgraphisomorphism
%python_clone -a %{buildroot}%{_bindir}/rdf2dot %python_clone -a %{buildroot}%{_bindir}/rdf2dot
%python_clone -a %{buildroot}%{_bindir}/csv2rdf %python_clone -a %{buildroot}%{_bindir}/csv2rdf
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%fdupes docs/_build/html
%if %{with tests} %if %{with tests}
%check %check
@ -114,6 +132,12 @@ popd
%python_uninstall_alternative rdf2dot %python_uninstall_alternative rdf2dot
%python_uninstall_alternative csv2rdf %python_uninstall_alternative csv2rdf
%if %{with doc}
%files -n %{name}-doc
%doc docs/_build/html
%else
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc README.md %doc README.md
@ -124,8 +148,6 @@ popd
%python_alternative %{_bindir}/rdfs2dot %python_alternative %{_bindir}/rdfs2dot
%{python_sitelib}/rdflib %{python_sitelib}/rdflib
%{python_sitelib}/rdflib-%{version}.dist-info %{python_sitelib}/rdflib-%{version}.dist-info
%endif
%files -n %{name}-doc
%doc docs/_build/html
%changelog %changelog