Allow bootstrap for new Python version

This commit is contained in:
Miro Hrončok 2022-06-15 16:59:34 +02:00
parent 887edf7bc1
commit 64c7d2a2df

View File

@ -15,18 +15,22 @@ Source0: https://github.com/networkx/networkx/archive/networkx-%{version}
# - plot_lines requires momepy
Patch0: %{name}-doc.patch
# There is a bootstrap loop between libpysal and networkx when tests/docs are enabled
%bcond_with bootstrap
BuildArch: noarch
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: %{py3_dist setuptools}
BuildRequires: %{py3_dist pip}
BuildRequires: %{py3_dist wheel}
%if %{without bootstrap}
BuildRequires: %{py3_dist matplotlib}
BuildRequires: %{py3_dist numpy}
BuildRequires: %{py3_dist pandas}
BuildRequires: %{py3_dist pip}
BuildRequires: %{py3_dist pygments}
BuildRequires: %{py3_dist scipy}
BuildRequires: %{py3_dist setuptools}
BuildRequires: %{py3_dist wheel}
%if 0%{?rhel} == 0
# Extras
@ -62,6 +66,7 @@ BuildRequires: sympy-doc
BuildRequires: tex(latex)
BuildRequires: tex-preview
%endif
%endif
%description
NetworkX is a Python package for the creation, manipulation, and
@ -78,6 +83,7 @@ Recommends: xdg-utils
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%if %{without bootstrap}
%if 0%{?rhel} == 0
%package doc
Summary: Documentation for networkx
@ -88,6 +94,7 @@ Provides: bundled(js-underscore)
%description doc
Documentation for networkx
%endif
%endif
%prep
%autosetup -p0 -n networkx-networkx-%{version}
@ -104,7 +111,7 @@ sed -e 's|\("https://docs\.python\.org/3/", \)None|\1"%{_docdir}/python3-docs/ht
%build
%pyproject_wheel
%if 0%{?rhel} == 0
%if %{without bootstrap} && 0%{?rhel} == 0
# Build the documentation
PYTHONPATH=%{pyproject_build_lib} make -C doc html
rst2html --no-datestamp README.rst README.html
@ -116,7 +123,7 @@ rst2html --no-datestamp README.rst README.html
mv %{buildroot}%{_docdir}/networkx-%{version} ./installed-docs
rm -f installed-docs/INSTALL.txt
%if 0%{?rhel} == 0
%if %{without bootstrap} && 0%{?rhel} == 0
# Repack uncompressed zip archives
for fil in $(find doc/build -name \*.zip); do
mkdir zip
@ -130,15 +137,19 @@ done
%check
%if 0%{?rhel} == 0
%if %{without bootstrap}
%pytest
%else
%pyproject_check_import -e '*.tests.*' -e '*.conftest'
%endif
%endif
%files -n python3-networkx -f %{pyproject_files}
%if 0%{?rhel} == 0
%if %{without bootstrap} && 0%{?rhel} == 0
%doc README.html installed-docs/*
%endif
%if 0%{?rhel} == 0
%if %{without bootstrap} && 0%{?rhel} == 0
%files doc
%doc doc/build/html/*
%endif