New upstream version (bz 1600361).

Also:
- Drop all patches.
- Drop the python2 subpackages (bz 1634570).
- Figure out the BuildRequires all over again (bz 1576805).
- Consolidate BuildRequires so I can tell what is actually on the list.
- Drop conditionals for RHEL < 8; this version can never appear there anyway.
- Consolidate back to a single package for the same reason.
- Temporarily disable tests due to multigraph bug in graphviz > 2.38.
This commit is contained in:
Jerry James 2018-10-13 13:31:26 -06:00
parent 8124f29f02
commit f48b7301a4
8 changed files with 96 additions and 434 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/networkx-1.9.1.tar.gz
/networkx-1.10.tar.gz
/networkx-1.11.tar.gz
/networkx-2.2.tar.gz

View File

@ -1,37 +0,0 @@
diff -Naur networkx-1.9.orig/networkx/tests/test.py networkx-1.9/networkx/tests/test.py
--- networkx-1.9.orig/networkx/tests/test.py 2014-06-25 11:50:58.000000000 -0600
+++ networkx-1.9/networkx/tests/test.py 2014-06-30 12:00:00.000000000 -0600
@@ -2,6 +2,24 @@
import sys
from os import path,getcwd
+import pkg_resources
+
+# If there is a conflicting non egg module,
+# i.e. an older standard system module installed,
+# then replace it with this requirement
+def replace_dist(requirement):
+ try:
+ return pkg_resources.require(requirement)
+ except pkg_resources.VersionConflict:
+ e = sys.exc_info()[1]
+ dist=e.args[0]
+ req=e.args[1]
+ if dist.key == req.key and not dist.location.endswith('.egg'):
+ del pkg_resources.working_set.by_key[dist.key]
+ # We assume there is no need to adjust sys.path
+ # and the associated pkg_resources.working_set.entries
+ return pkg_resources.require(requirement)
+
def run(verbosity=1,doctest=False,numpy=True):
"""Run NetworkX tests.
@@ -16,6 +34,8 @@
numpy: bool, optional
True to test modules dependent on numpy
"""
+ replace_dist("nose >= 1.0")
+
try:
import nose
except ImportError:

View File

@ -1,20 +0,0 @@
With recent versions of numpy, the original expression results in:
TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('int64')
with casting rule 'same_kind'
This patch solves the issue by not trying to add in place.
diff -Naur networkx-networkx-1.10.orig/networkx/linalg/algebraicconnectivity.py networkx-networkx-1.10/networkx/linalg/algebraicconnectivity.py
--- networkx-networkx-1.10.orig/networkx/linalg/algebraicconnectivity.py 2015-10-30 15:41:35.000000000 -0600
+++ networkx-networkx-1.10/networkx/linalg/algebraicconnectivity.py 2015-12-01 09:49:51.568953316 -0700
@@ -244,8 +244,7 @@
W -= (W.T * X * X.T).T
project(W)
# Compute the diagonal of P * L * P as a Jacobi preconditioner.
- D = L.diagonal()
- D += 2. * (asarray(X) * asarray(W)).sum(axis=1)
+ D = L.diagonal() + 2. * (asarray(X) * asarray(W)).sum(axis=1)
D += (asarray(X) * asarray(X * (W.T * X))).sum(axis=1)
D[D < tol * Lnorm] = 1.
D = 1. / D

View File

@ -1,29 +0,0 @@
make importing of drawing and geo subpackages optional
diff -Naur networkx-networkx-1.10.orig/networkx/__init__.py networkx-networkx-1.10/networkx/__init__.py
--- networkx-networkx-1.10.orig/networkx/__init__.py 2015-10-30 15:41:35.000000000 -0600
+++ networkx-networkx-1.10/networkx/__init__.py 2015-11-24 09:34:20.741823392 -0700
@@ -95,5 +95,8 @@
from networkx.linalg import *
from networkx.tests.test import run as test
-import networkx.drawing
-from networkx.drawing import *
+try:
+ import networkx.drawing
+ from networkx.drawing import *
+except ImportError:
+ pass
diff -Naur networkx-networkx-1.10.orig/networkx/readwrite/__init__.py networkx-networkx-1.10/networkx/readwrite/__init__.py
--- networkx-networkx-1.10.orig/networkx/readwrite/__init__.py 2015-10-30 15:41:35.000000000 -0600
+++ networkx-networkx-1.10/networkx/readwrite/__init__.py 2015-11-24 09:34:46.539738141 -0700
@@ -14,4 +14,8 @@
from networkx.readwrite.gml import *
from networkx.readwrite.graphml import *
from networkx.readwrite.gexf import *
-from networkx.readwrite.nx_shp import *
+
+try:
+ from networkx.readwrite.nx_shp import *
+except ImportError:
+ pass

View File

@ -1,64 +0,0 @@
el6 currently has scipy 0.7 and the following is only supported by 0.8:
networkx.current_flow_betweenness_centrality(...,normalized=False,...)
Also on el6 the drawing/tests/test_layout.py fails as the following is only supported by 0.8:
scipy.sparse.linalg.eigen_symmetric
diff -Naur networkx-1.9.orig/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py networkx-1.9/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py
--- networkx-1.9.orig/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py 2014-06-25 11:50:58.000000000 -0600
+++ networkx-1.9/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py 2014-06-30 12:00:00.000000000 -0600
@@ -41,17 +41,6 @@
for n in sorted(G):
assert_almost_equal(b[n],wb_answer[n])
- def test_K4(self):
- """Betweenness centrality: K4"""
- G=networkx.complete_graph(4)
- for solver in ['full','lu','cg']:
- b=networkx.current_flow_betweenness_centrality(G, normalized=False,
- solver=solver)
- b_answer={0: 0.75, 1: 0.75, 2: 0.75, 3: 0.75}
- for n in sorted(G):
- assert_almost_equal(b[n],b_answer[n])
-
-
def test_P4_normalized(self):
"""Betweenness centrality: P4 normalized"""
G=networkx.path_graph(4)
@@ -80,16 +69,6 @@
- def test_solers(self):
- """Betweenness centrality: alternate solvers"""
- G=networkx.complete_graph(4)
- for solver in ['full','lu','cg']:
- b=networkx.current_flow_betweenness_centrality(G,normalized=False,
- solver=solver)
- b_answer={0: 0.75, 1: 0.75, 2: 0.75, 3: 0.75}
- for n in sorted(G):
- assert_almost_equal(b[n],b_answer[n])
-
class TestApproximateFlowBetweennessCentrality(object):
diff -Naur networkx-1.9.orig/networkx/drawing/tests/test_layout.py networkx-1.9/networkx/drawing/tests/test_layout.py
--- networkx-1.9.orig/networkx/drawing/tests/test_layout.py 2014-06-25 11:50:58.000000000 -0600
+++ networkx-1.9/networkx/drawing/tests/test_layout.py 2014-06-30 12:00:00.000000000 -0600
@@ -46,16 +46,3 @@
pos=nx.drawing.layout._fruchterman_reingold(A)
pos=nx.drawing.layout._fruchterman_reingold(A,dim=3)
assert_equal(pos.shape,(6,3))
-
- def test_adjacency_interface_scipy(self):
- try:
- import scipy
- except ImportError:
- raise SkipTest('scipy not available.')
-
- A=nx.to_scipy_sparse_matrix(self.Gs,dtype='d')
- pos=nx.drawing.layout._sparse_fruchterman_reingold(A)
- pos=nx.drawing.layout._sparse_spectral(A)
-
- pos=nx.drawing.layout._sparse_fruchterman_reingold(A,dim=3)
- assert_equal(pos.shape,(6,3))

View File

@ -1,11 +0,0 @@
diff -up networkx-networkx-1.11/doc/source/conf.py.sphinx networkx-networkx-1.11/doc/source/conf.py
--- networkx-networkx-1.11/doc/source/conf.py.sphinx 2016-01-30 10:25:44.000000000 -0700
+++ networkx-networkx-1.11/doc/source/conf.py 2016-12-23 09:54:55.280925006 -0700
@@ -74,7 +74,6 @@ extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
- 'sphinx.ext.pngmath',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
#'sphinxcontrib.bibtex',

View File

@ -1,321 +1,143 @@
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_python3 1
%endif
%if 0%{?fedora} || 0%{?rhel} > 7
%global with_gdal 1
%endif
%global srcname networkx
Name: python-%{srcname}
Version: 1.11
Release: 13%{?dist}
Version: 2.2
Release: 1%{?dist}
Summary: Creates and Manipulates Graphs and Networks
License: BSD
URL: http://networkx.github.io/
Source0: https://github.com/networkx/networkx/archive/%{srcname}-%{version}.tar.gz
Patch0: %{srcname}-optional-modules.patch
Patch1: %{srcname}-nose1.0.patch
Patch2: %{srcname}-skip-scipy-0.8-tests.patch
# Fix sphinx build error
# https://github.com/networkx/networkx/issues/2340
Patch3: python-networkx-sphinx.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3dist(decorator)
BuildRequires: python3dist(gdal)
BuildRequires: python3dist(lxml)
BuildRequires: python3dist(matplotlib)
BuildRequires: python3dist(nb2plots)
BuildRequires: python3dist(nose)
BuildRequires: python3dist(nose-ignore-docstring)
BuildRequires: python3dist(numpy)
BuildRequires: python3dist(numpydoc)
BuildRequires: python3dist(pandas)
BuildRequires: python3dist(pillow)
BuildRequires: python3dist(pydot)
BuildRequires: python3dist(pygraphviz)
BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(scipy)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
BuildRequires: python3dist(sphinx-gallery)
BuildRequires: xdg-utils
# Documentation
BuildRequires: tex(latex)
BuildRequires: tex-preview
%description
NetworkX is a Python 2 package for the creation, manipulation, and
NetworkX is a Python package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python2-%{srcname}
Summary: Creates and Manipulates Graphs and Networks
Requires: python2-%{srcname}-core = %{version}-%{release}
%if 0%{?with_gdal}
Requires: python2-%{srcname}-geo = %{version}-%{release}
Requires: python2-%{srcname}-drawing = %{version}-%{release}
%endif
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
NetworkX is a Python 2 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python2-%{srcname}-core
Summary: Creates and Manipulates Graphs and Networks
BuildRequires: python2-devel
BuildRequires: python2-decorator
BuildRequires: python2-scipy
BuildRequires: python2-setuptools
BuildRequires: python2-yaml
BuildRequires: python2-pyparsing
%if 0%{?rhel} == 6
BuildRequires: python-nose1.1
%else
BuildRequires: python2-nose
%endif
Requires: python2-decorator
Requires: python2-scipy
Requires: python2-yaml
Requires: python2-pyparsing
%{?python_provide:%python_provide python2-%{srcname}-core}
%description -n python2-%{srcname}-core
NetworkX is a Python 2 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%if 0%{?with_gdal}
%package -n python2-%{srcname}-geo
Summary: GDAL I/O
Requires: python2-%{srcname}-core = %{version}-%{release}
BuildRequires: python2-gdal
Requires: python2-gdal
%{?python_provide:%python_provide python2-%{srcname}-geo}
%description -n python2-%{srcname}-geo
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides GDAL I/O support.
%package -n python2-%{srcname}-drawing
Summary: visual representations for graphs and networks
Requires: python2-%{srcname}-core = %{version}-%{release}
BuildRequires: python2.7dist(gv)
BuildRequires: python2-matplotlib
BuildRequires: python2-pydotplus
Requires: python2.7dist(gv)
Requires: python2-matplotlib
Requires: python2-pydotplus
%{?python_provide:%python_provide python2-%{srcname}-drawing}
%description -n python2-%{srcname}-drawing
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides support for graph visualizations.
%endif
%if 0%{?with_python3}
%package -n python3-%{srcname}
Summary: Creates and Manipulates Graphs and Networks
Requires: python3-%{srcname}-core = %{version}-%{release}
Requires: python3-%{srcname}-geo = %{version}-%{release}
Requires: python3-%{srcname}-drawing = %{version}-%{release}
Requires: python3dist(decorator)
Requires: python3dist(gdal)
Requires: python3dist(lxml)
Requires: python3dist(matplotlib)
Requires: python3dist(numpy)
Requires: python3dist(pandas)
Requires: python3dist(pillow)
Requires: python3dist(pydot)
Requires: python3dist(pygraphviz)
Requires: python3dist(pyparsing)
Requires: python3dist(pyyaml)
Requires: python3dist(scipy)
Requires: xdg-utils
%{?python_provide:%python_provide python3-%{srcname}}
# This can be removed when Fedora 29 reaches EOL
Obsoletes: python2-%{srcname} < 2.0
Provides: python2-%{srcname} = %{version}-%{release}
Obsoletes: python2-%{srcname}-core < 2.0
Provides: python2-%{srcname}-core = %{version}-%{release}
Obsoletes: python2-%{srcname}-geo < 2.0
Provides: python2-%{srcname}-geo = %{version}-%{release}
Obsoletes: python2-%{srcname}-drawing < 2.0
Provides: python2-%{srcname}-drawing = %{version}-%{release}
Obsoletes: python3-%{srcname}-core < 2.0
Provides: python3-%{srcname}-core = %{version}-%{release}
Obsoletes: python3-%{srcname}-geo < 2.0
Provides: python3-%{srcname}-geo = %{version}-%{release}
Obsoletes: python3-%{srcname}-drawing < 2.0
Provides: python3-%{srcname}-drawing = %{version}-%{release}
%description -n python3-%{srcname}
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%package -n python3-%{srcname}-core
Summary: Creates and Manipulates Graphs and Networks
BuildRequires: python3-devel
BuildRequires: python3-decorator
BuildRequires: python3-yaml
BuildRequires: python3-scipy
BuildRequires: python3-pyparsing
BuildRequires: python3-setuptools
Requires: python3-decorator
Requires: python3-yaml
Requires: python3-scipy
Requires: python3-pyparsing
%{?python_provide:%python_provide python3-%{srcname}-core}
%description -n python3-%{srcname}-core
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
%if 0%{?with_gdal}
%package -n python3-%{srcname}-geo
Summary: GDAL I/O
Requires: python3-%{srcname}-core = %{version}-%{release}
BuildRequires: gdal-python3
Requires: gdal-python3
%{?python_provide:%python_provide python3-%{srcname}-geo}
%description -n python3-%{srcname}-geo
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides GDAL I/O support.
%package -n python3-%{srcname}-drawing
Summary: visual representations for graphs and networks
Requires: python3-%{srcname}-core = %{version}-%{release}
BuildRequires: python3-matplotlib
BuildRequires: python3-pydotplus
Requires: python3-matplotlib
Requires: python3-pydotplus
%{?python_provide:%python_provide python3-%{srcname}-drawing}
%description -n python3-%{srcname}-drawing
NetworkX is a Python 3 package for the creation, manipulation, and
study of the structure, dynamics, and functions of complex networks.
This package provides support for graph visualizations.
%endif
%endif
%package doc
Summary: Documentation for networkx
%if 0%{?rhel} == 6
BuildRequires: python-sphinx10
%else
BuildRequires: python2-pandas
BuildRequires: python2-pydotplus
BuildRequires: python2-sphinx
BuildRequires: python2-sphinx_rtd_theme
BuildRequires: python2-sphinxcontrib-bibtex
BuildRequires: python2-ipython
BuildRequires: python2-numpydoc
%endif
BuildRequires: tex(latex)
BuildRequires: tex-preview
BuildRequires: python2-matplotlib
Provides: bundled(jquery)
%description doc
Documentation for networkx
%prep
%setup -q -n %{srcname}-%{srcname}-%{version}
%patch0 -p1
%if 0%{?rhel} == 6
%patch1 -p1
%patch2 -p1
%endif
%patch3 -p1 -b .sphinx
%autosetup -n %{srcname}-%{srcname}-%{version}
# Fix permissions
find examples -type f -perm /0111 -exec chmod a-x {} +
# Do not use env
for f in $(grep -FRl %{_bindir}/env .); do
sed -e 's,%{_bindir}/env python,%{__python3},' \
-e 's,%{_bindir}/env ,%{_bindir},' \
-i.orig $f
touch -r $f.orig $f
rm $f.orig
done
# Examples that require network access fail on the koji builders, the
# sphinx_gallery version of system.out has no attribute named 'buffer', and
# the Unix email example has multiple python 3 incompatibilities
sed -i "/expected_failing_examples/s|]|,'../examples/graph/plot_football.py','../examples/graph/plot_erdos_renyi.py','../examples/basic/plot_read_write.py'&|" doc/conf.py
rm -f examples/drawing/plot_unix_email.py
%build
%py2_build
sed -i 's/^[[:blank:]]*python/&2/' doc/Makefile
%if 0%{?rhel} == 6
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-1.0-build -C doc html
%else
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-build-2 -C doc html
%endif
%if 0%{?with_python3}
# Setup for python3
mv build build2
mv networkx/*.pyc build2
# Build for python3
%py3_build
%endif
# Build the documentation
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-build-3 -C doc html
%install
%if 0%{?with_python3}
# Install the python3 version
%py3_install
# Setup for python2
mv build build3
mv build2 build
mv -f build/*.pyc networkx
%endif
# Install the python2 version
%py2_install
mv $RPM_BUILD_ROOT%{_docdir}/networkx-%{version} ./installed-docs
mv %{buildroot}%{_docdir}/networkx-%{version} ./installed-docs
rm -f installed-docs/INSTALL.txt
# Fix permissions and binary paths
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python2_sitelib}`; do
sed 's|/usr/bin/env python|%{_bindir}/python2|' $f > $f.new
touch -r $f $f.new
chmod a+x $f.new
mv -f $f.new $f
done
# Temporarily disabled until a bug in graphviz > 2.38 is fixed that causes
# multigraphs to not work. (Adding the same edge with multiple keys yields
# only the initial edge.) This is slated to be fixed in graphviz 2.42. Once
# that is built for Fedora, we can reenable the tests.
#%%check
#nosetests-3 -v
%if 0%{?with_python3}
for f in `grep -FRl /usr/bin/env $RPM_BUILD_ROOT%{python3_sitelib}`; do
sed 's|/usr/bin/env python|%{_bindir}/python3|' $f > $f.new
touch -r $f $f.new
chmod a+x $f.new
mv -f $f.new $f
done
%endif
%clean
rm -fr %{buildroot}
rm -f /tmp/tmp??????
%check
mkdir site-packages
mv networkx site-packages
PYTHONPATH=$PWD/site-packages python2 -c "import networkx; networkx.test()"
%files -n python2-%{srcname}
%doc README.rst
%license LICENSE.txt
%files -n python2-%{srcname}-core
%doc installed-docs/*
%{python2_sitelib}/*
%exclude %{python2_sitelib}/networkx/drawing/
%if 0%{?with_gdal}
%exclude %{python2_sitelib}/networkx/readwrite/nx_shp.py*
%endif
%if 0%{?with_gdal}
%files -n python2-%{srcname}-drawing
%{python2_sitelib}/networkx/drawing
%files -n python2-%{srcname}-geo
%{python2_sitelib}/networkx/readwrite/nx_shp.py*
%endif
%if 0%{?with_python3}
%files -n python3-networkx
%doc README.rst
%doc README.rst installed-docs/*
%license LICENSE.txt
%files -n python3-networkx-core
%doc installed-docs/*
%{python3_sitelib}/*
%exclude %{python3_sitelib}/networkx/drawing/
%if 0%{?with_gdal}
%exclude %{python3_sitelib}/networkx/readwrite/nx_shp.py
%exclude %{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
%endif
%if 0%{?with_gdal}
%files -n python3-networkx-drawing
%{python3_sitelib}/networkx/drawing
%files -n python3-networkx-geo
%{python3_sitelib}/networkx/readwrite/nx_shp.py
%{python3_sitelib}/networkx/readwrite/__pycache__/nx_shp.*
%endif
%endif
%{python3_sitelib}/networkx*
%files doc
%doc doc/build/html/*
%changelog
* Sat Oct 13 2018 Jerry James <loganjerry@gmail.com> - 2.2-1
- New upstream version (bz 1600361)
- Drop all patches
- Drop the python2 subpackages (bz 1634570)
- Figure out the BuildRequires all over again (bz 1576805)
- Consolidate BuildRequires so I can tell what is actually on the list
- Drop conditionals for RHEL < 8; this version can never appear there anyway
- Consolidate back to a single package for the same reason
- Temporarily disable tests due to multigraph bug in graphviz > 2.38
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View File

@ -1 +1 @@
986c399d93995676fc1c65446c92d433 networkx-1.11.tar.gz
SHA512 (networkx-2.2.tar.gz) = 247ca4d66d33cec86412df846cc1fdbe1cbb0eeee83fb2a9ccdd702eb1453dd7167b397ed77d6b3dfdef6346485160ce75c12be58372238aaf98d334b4c8aeb4