1
0
python-networkx/python-networkx.spec

126 lines
4.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-networkx
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python3-%{**}}
Name: python-networkx
Version: 2.8.8
Release: 0
Summary: Python package for the study of complex networks
License: BSD-3-Clause
URL: https://networkx.github.io/
Source: https://files.pythonhosted.org/packages/source/n/networkx/networkx-%{version}.tar.gz
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
Requires: python-matplotlib >= 3.4
Requires: python-numpy >= 1.19
Requires: python-pandas >= 1.3
Requires: python-scipy >= 1.8
Recommends: python-PyYAML
Recommends: python-pydot >= 1.4.2
Recommends: python-pygraphviz
Recommends: python-pyparsing
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module lxml >= 4.6}
BuildRequires: %{python_module matplotlib >= 3.4}
BuildRequires: %{python_module numpy >= 1.19}
BuildRequires: %{python_module pandas >= 1.3}
BuildRequires: %{python_module pydot >= 1.4.2}
BuildRequires: %{python_module pygraphviz >= 1.9}
BuildRequires: %{python_module pyparsing}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy >= 1.8}
# /SECTION
%python_subpackages
%description
NetworkX (NX) is a Python package for the creation, manipulation, and study of the structure, dynamics,
and functions of complex networks.
Features:
* Includes standard graph-theoretic and statistical physics functions
* Exchange of network algorithms between applications, disciplines, and platforms
* Includes many classic graphs and synthetic networks
* Nodes and edges can be "anything" (e.g. time-series, text, images, XML records)
* Exploits existing code from high-quality legacy software in C, C++, Fortran, etc.
* Unit-tested
%package -n %{name}-doc
Summary: Documentation for %{name}
Provides: %{python_module networkx-doc = %{version}}
%description -n %{name}-doc
Documentation and examples for %{name}.
%prep
%setup -q -n networkx-%{version}
%autopatch -p1
%build
%python_build
%install
%python_install
# Move docs into correct directory if necessary
if [ "%{_docdir}" != "%{_datadir}/doc" ] ; then
mkdir -p %{buildroot}%{_docdir}/
mv %{buildroot}%{_datadir}/doc/networkx-%{version} %{buildroot}%{_docdir}/
fi
%fdupes %{buildroot}%{_docdir}
%{python_expand pushd %{buildroot}%{$python_sitelib}
# Fix wrong-script-interpreter
find networkx -name '*test*.py' -exec sed -i "s|#!%{_bindir}/env python$|#!%__$python|" {} +
find networkx -name '*test*.py' -exec sed -i "s|#!%{_bindir}/env python3$|#!%__$python|" {} +
find networkx -name '*test*.py' -exec grep -q '#!%__$python' {} \; -exec chmod a+x {} +
# Deduplicating files can generate a RPMLINT warning for pyc mtime
find networkx -name '*test*.py' -exec $python -m compileall -d %{$python_sitelib} {} \;
find networkx -name '*test*.py' -exec $python -O -m compileall -d %{$python_sitelib} {} \;
rm -f _current_flavor
%fdupes .
popd
}
%check
# gh#networkx/networkx#4030 we cannot use -n auto because
# TestKatzCentralityDirectedNumpy fails otherwise
# (pandas) test_from_adjacency_named fails on i586
%if 0%{?suse_version} < 1550
- update to 2.8.2: * Fix doc deploy * Bump release version * MAINT: Update dfs_test with more comprehensive tests (#5654) * Bump release version * Fix __setstate__ for OutEdgeView subclasses, read _adjdict from state (#5657) * Add examples & improve documentation of voterank (#5500) * Change default value of arrowstyle for undirected graphs (#5514) * added edge labels in weighted graph (#5521) * Added examples in is_forest() and is_tree() (#5524) * a hack to force self edges to be ignored on the first node inspected (#5516) * De-Regression: eagerly evaluate not_implemented_for in decorated generators (#5537) * Improve documentation of PlanarEmbedding class (#5523) * PlanarEmbedding in autosummary instead of autoclass. (#5548) * Added examples in tournament and tree functions (#5536) * Fixup PlanarEmbedding See Also (#5556) * Fix min_edge_cover in special cases (#5538) and correct documentation (#5549) * Add is_planar function. Solves issue #5109 (#5544) * Improve bridges documentation (#5519) * fix greedy_modularity when multiple components exist. (#5550) * Fix issue probably-meant-fstring found at https://codereview.doctor (#5574) * MAINT: Fix sphinx build errors and warnings (#5571) * replace induced_subgraph example with directly relevant example (#5576) * Add examples to compose operation (#5583) * Fix reference in label_propagation_communities docstring (#5588) * Use sets instead of lists for collecting flowfuncs in tests. (#5589) * Update .degree() docs: outdated return type (#5529) * Update numpydoc (#5580) * Add a space in an error (#5601) * improve docstring for read_doc, see issue #5604 (#5605) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-networkx?expand=0&rev=46
2022-06-04 17:50:50 +00:00
rm -v networkx/drawing/tests/test_pydot.py
%endif
%pytest -rs -k 'not test_from_adjacency_named and not test_asadpour_tsp'
%files %{python_files}
%license LICENSE.txt
%doc README.rst CONTRIBUTING.rst
%{python_sitelib}/networkx/
%{python_sitelib}/networkx-%{version}-py*.egg-info
%files -n %{name}-doc
%license LICENSE.txt
%doc %{_docdir}/networkx-%{version}/
%changelog