14
0
2024-05-23 02:33:42 +00:00
committed by Git OBS Bridge
parent cd5ebf99f0
commit 4cb969d596
3 changed files with 37 additions and 12 deletions

3
_multibuild Normal file
View File

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

View File

@@ -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: - Update to 1.13:
* Remove outdated pystrings.swg (#508). * 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). * Add pyproject.toml (#471).
* Stop building pdf of the docs (#503). * Stop building pdf of the docs (#503).
- Drop patch docdir.patch, no longer needed. - 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. - Switch to pyproject macros.
------------------------------------------------------------------- -------------------------------------------------------------------

View File

@@ -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} %{?sle15_python_module_pythons}
Name: python-pygraphviz Name: python-pygraphviz%{psuffix}
Version: 1.13 Version: 1.13
Release: 0 Release: 0
Summary: Python interface to Graphviz 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 # https://github.com/pygraphviz/pygraphviz/issues/532
Source1: https://raw.githubusercontent.com/pygraphviz/pygraphviz/main/examples/README.txt Source1: https://raw.githubusercontent.com/pygraphviz/pygraphviz/main/examples/README.txt
BuildRequires: %{python_module devel >= 3.10} BuildRequires: %{python_module devel >= 3.10}
# Needed even without tests
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
@@ -38,12 +44,15 @@ BuildRequires: graphviz-devel >= 2.42
BuildRequires: graphviz-gd BuildRequires: graphviz-gd
BuildRequires: libpng-devel BuildRequires: libpng-devel
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
# For building the docs %if %{with doc}
BuildRequires: %{python_module pygraphviz = %{version}}
BuildRequires: python3-Sphinx BuildRequires: python3-Sphinx
BuildRequires: python3-matplotlib BuildRequires: python3-matplotlib
BuildRequires: python3-numpydoc BuildRequires: python3-numpydoc
BuildRequires: python3-pydata-sphinx-theme BuildRequires: python3-pydata-sphinx-theme
BuildRequires: python3-sphinx-gallery BuildRequires: python3-sphinx-gallery
BuildArch: noarch
%endif
BuildRequires: swig BuildRequires: swig
Requires: graphviz >= 2.42 Requires: graphviz >= 2.42
%if 0%{?suse_version} >= 1550 %if 0%{?suse_version} >= 1550
@@ -68,17 +77,25 @@ cp %SOURCE1 examples
%build %build
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
%if ! %{with doc}
%pyproject_wheel %pyproject_wheel
%else
make -C doc html
%endif
%install %install
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
%if ! %{with doc}
%pyproject_install %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} mkdir -p %{buildroot}%{_docdir}/pygraphviz-%{version}
cp -ar doc/build/html/* %{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 %check
# We don't want to run the tests from the topdir # We don't want to run the tests from the topdir
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
@@ -87,18 +104,22 @@ pushd $tmpdir
# skip tests because of gh#pygraphviz/pygraphviz#366 # 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" 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)" %pytest_arch -k "not ($donttest)"
%endif
popd popd
rm -rf $tmpdir rm -rf $tmpdir
%endif
%if ! %{with doc}
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python_sitearch}/pygraphviz %{python_sitearch}/pygraphviz
%{python_sitearch}/pygraphviz-%{version}.dist-info %{python_sitearch}/pygraphviz-%{version}.dist-info
%endif
%files -n %{name}-doc %if %{with doc}
%files -n %{name}
%license LICENSE %license LICENSE
%{_docdir}/pygraphviz-%{version} %{_docdir}/pygraphviz-%{version}
%endif
%changelog %changelog