forked from pool/python-pygraphviz
Inject -doc multibuild
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pygraphviz?expand=0&rev=30
This commit is contained in:
3
_multibuild
Normal file
3
_multibuild
Normal file
@@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>doc</package>
|
||||
</multibuild>
|
@@ -1,5 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed May 22 02:06:25 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
Thu May 23 02:32:41 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.13:
|
||||
* Remove outdated pystrings.swg (#508).
|
||||
@@ -13,7 +13,8 @@ Wed May 22 02:06:25 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
* Add pyproject.toml (#471).
|
||||
* Stop building pdf of the docs (#503).
|
||||
- Drop patch docdir.patch, no longer needed.
|
||||
- Build the documentation by hand, since now we need to.
|
||||
- Build the documentation by hand, since now we need to, and do so in
|
||||
its own flavor.
|
||||
- Switch to pyproject macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
@@ -16,9 +16,16 @@
|
||||
#
|
||||
|
||||
|
||||
%bcond_without tests
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "doc"
|
||||
%define psuffix -doc
|
||||
%bcond_without doc
|
||||
%else
|
||||
%define psuffix %{nil}
|
||||
%bcond_with doc
|
||||
%endif
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-pygraphviz
|
||||
Name: python-pygraphviz%{psuffix}
|
||||
Version: 1.13
|
||||
Release: 0
|
||||
Summary: Python interface to Graphviz
|
||||
@@ -28,9 +35,8 @@ Source: https://files.pythonhosted.org/packages/source/p/pygraphviz/pygr
|
||||
# https://github.com/pygraphviz/pygraphviz/issues/532
|
||||
Source1: https://raw.githubusercontent.com/pygraphviz/pygraphviz/main/examples/README.txt
|
||||
BuildRequires: %{python_module devel >= 3.10}
|
||||
# Needed even without tests
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
@@ -38,12 +44,15 @@ BuildRequires: graphviz-devel >= 2.42
|
||||
BuildRequires: graphviz-gd
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: python-rpm-macros
|
||||
# For building the docs
|
||||
%if %{with doc}
|
||||
BuildRequires: %{python_module pygraphviz = %{version}}
|
||||
BuildRequires: python3-Sphinx
|
||||
BuildRequires: python3-matplotlib
|
||||
BuildRequires: python3-numpydoc
|
||||
BuildRequires: python3-pydata-sphinx-theme
|
||||
BuildRequires: python3-sphinx-gallery
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
BuildRequires: swig
|
||||
Requires: graphviz >= 2.42
|
||||
%if 0%{?suse_version} >= 1550
|
||||
@@ -68,17 +77,25 @@ cp %SOURCE1 examples
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
%if ! %{with doc}
|
||||
%pyproject_wheel
|
||||
%else
|
||||
make -C doc html
|
||||
%endif
|
||||
|
||||
%install
|
||||
export CFLAGS="%{optflags}"
|
||||
%if ! %{with doc}
|
||||
%pyproject_install
|
||||
PYTHONPATH=%{buildroot}%{python3_sitearch} make -C doc html
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
# Don't ship swig source
|
||||
%python_expand rm %{buildroot}%{$python_sitearch}/pygraphviz/graphviz_wrap.c
|
||||
%else
|
||||
mkdir -p %{buildroot}%{_docdir}/pygraphviz-%{version}
|
||||
cp -ar doc/build/html/* %{buildroot}%{_docdir}/pygraphviz-%{version}
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
||||
%endif
|
||||
|
||||
%if %{with tests}
|
||||
%if ! %{with doc}
|
||||
%check
|
||||
# We don't want to run the tests from the topdir
|
||||
tmpdir=$(mktemp -d)
|
||||
@@ -87,18 +104,22 @@ pushd $tmpdir
|
||||
# skip tests because of gh#pygraphviz/pygraphviz#366
|
||||
donttest="test_drawing_makes_file or test_drawing_makes_file1 or test_drawing_makes_file or test_drawing_png_output_with_NULL_smoketest"
|
||||
%pytest_arch -k "not ($donttest)"
|
||||
%endif
|
||||
popd
|
||||
rm -rf $tmpdir
|
||||
%endif
|
||||
|
||||
%if ! %{with doc}
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc README.rst
|
||||
%{python_sitearch}/pygraphviz
|
||||
%{python_sitearch}/pygraphviz-%{version}.dist-info
|
||||
%endif
|
||||
|
||||
%files -n %{name}-doc
|
||||
%if %{with doc}
|
||||
%files -n %{name}
|
||||
%license LICENSE
|
||||
%{_docdir}/pygraphviz-%{version}
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user