forked from pool/python-networkx
- Update to 3.3 * Add @nx._dispatch decorator to most algorithms * Remove topo_order kwarg from is_semiconnected without deprecation * API: Add a decorator to deprecate positional args * Drop support for Python 3.8 and 3.9 * Support Python 3.12 * Test on Python 3.13-dev * Don't test numpy2 nightlies * Unpin scipy upperbound for tests * Disallow negative number of nodes in complete_multipartite_graph * [A-star] Added expansion pruning via cutoff if cutoff is provided * Add Tadpole graph * [Feat] Random expanders utilities * Add Kirchhoff index / Effective graph resistance * Changed return types of shortest path methods to improve consistency * Many more changes, see upstream changelog - drop doc build, PyPI tarball doesn't support it anymore OBS-URL: https://build.opensuse.org/request/show/1169974 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-networkx?expand=0&rev=58
110 lines
3.8 KiB
RPMSpec
110 lines
3.8 KiB
RPMSpec
#
|
|
# spec file for package python-networkx
|
|
#
|
|
# Copyright (c) 2024 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/
|
|
#
|
|
|
|
|
|
%{?sle15_python_module_pythons}
|
|
Name: python-networkx
|
|
Version: 3.3
|
|
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 pip}
|
|
BuildRequires: %{python_module wheel}
|
|
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
|
|
|
|
%prep
|
|
%setup -q -n networkx-%{version}
|
|
%autopatch -p1
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
|
|
%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
|
|
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}*info
|
|
|
|
%changelog
|