New upstream version.

Also:
- Update URLs.
- Add -numpy patch to fix test failure.
This commit is contained in:
Jerry James 2015-12-01 11:43:57 -07:00
parent d3b8513d73
commit a2a62ea27e
5 changed files with 52 additions and 24 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/networkx_tutorial.pdf
/networkx-documentation.zip
/networkx-1.9.1.tar.gz
/networkx-1.10.tar.gz

20
networkx-numpy.patch Normal file
View File

@ -0,0 +1,20 @@
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,23 +1,22 @@
make importing of drawing and geo subpackages optional
diff -Naur networkx-1.9.orig/networkx/__init__.py networkx-1.9/networkx/__init__.py
--- networkx-1.9.orig/networkx/__init__.py 2014-06-25 12:02:09.000000000 -0600
+++ networkx-1.9/networkx/__init__.py 2014-06-30 12:00:00.000000000 -0600
@@ -84,6 +84,8 @@
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-1.9.orig/networkx/readwrite/__init__.py networkx-1.9/networkx/readwrite/__init__.py
--- networkx-1.9.orig/networkx/readwrite/__init__.py 2014-06-25 11:50:58.000000000 -0600
+++ networkx-1.9/networkx/readwrite/__init__.py 2014-06-30 12:00:00.000000000 -0600
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 *

View File

@ -15,18 +15,20 @@
%global pkgname networkx
Name: python-%{pkgname}
Version: 1.9.1
Release: 5%{?dist}
Version: 1.10
Release: 1%{?dist}
Summary: Creates and Manipulates Graphs and Networks
License: BSD
URL: http://networkx.github.io/
Source0: https://pypi.python.org/packages/source/n/%{pkgname}/%{pkgname}-%{version}.tar.gz
Source1: http://networkx.github.io/documentation/%{pkgname}-%{version}/_downloads/networkx_reference.pdf
Source2: http://networkx.github.io/documentation/%{pkgname}-%{version}/_downloads/networkx_tutorial.pdf
Source3: http://networkx.github.io/documentation/%{pkgname}-%{version}/_downloads/networkx-documentation.zip
Source0: https://github.com/networkx/networkx/archive/%{pkgname}-%{version}.tar.gz
Source1: https://github.com/networkx/documentation/blob/gh-pages/%{pkgname}-%{version}/_downloads/networkx_reference.pdf
Source2: https://github.com/networkx/documentation/blob/gh-pages/%{pkgname}-%{version}/_downloads/networkx_tutorial.pdf
Source3: https://github.com/networkx/documentation/blob/gh-pages/%{pkgname}-%{version}/_downloads/networkx-documentation.zip
Patch0: %{pkgname}-optional-modules.patch
Patch1: %{pkgname}-nose1.0.patch
Patch2: %{pkgname}-skip-scipy-0.8-tests.patch
# Fix failure to add 2 matrices with recent numpy versions
Patch3: %{pkgname}-numpy.patch
BuildArch: noarch
Requires: %{name}-core = %{version}-%{release}
@ -162,7 +164,7 @@ Summary: Documentation for networkx
%if 0%{?rhel} == 6
BuildRequires: python-sphinx10
%else
BuildRequires: python-sphinx
BuildRequires: python2-sphinx
BuildRequires: python-sphinx_rtd_theme
BuildRequires: python-numpydoc
%endif
@ -177,12 +179,13 @@ Documentation for networkx
%prep
%setup -q -n %{pkgname}-%{version}
%setup -q -n %{pkgname}-%{pkgname}-%{version}
%patch0 -p1
%if 0%{?rhel} == 6
%patch1 -p1
%patch2 -p1
%endif
%patch3 -p1
# Fix permissions
find examples -type f -perm /0111 | xargs chmod a-x
@ -195,7 +198,7 @@ python2 setup.py build
%if 0%{?rhel} == 6
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-1.0-build -C doc html
%else
PYTHONPATH=$PWD/build/lib make -C doc html
PYTHONPATH=$PWD/build/lib make SPHINXBUILD=sphinx-build-2 -C doc html
%endif
%if 0%{?with_python3}
@ -247,10 +250,10 @@ rm -f /tmp/tmp??????
%check
mkdir site-packages
mv networkx site-packages
PYTHONPATH=`pwd`/site-packages python -c "import networkx; networkx.test()"
PYTHONPATH=$PWD/site-packages python -c "import networkx; networkx.test()"
%files
%doc README.txt
%doc README.rst
%license LICENSE.txt
%files core
@ -271,7 +274,7 @@ PYTHONPATH=`pwd`/site-packages python -c "import networkx; networkx.test()"
%if 0%{?with_python3}
%files -n python3-networkx
%doc README.txt
%doc README.rst
%license LICENSE.txt
%files -n python3-networkx-core
@ -299,6 +302,11 @@ PYTHONPATH=`pwd`/site-packages python -c "import networkx; networkx.test()"
%changelog
* Tue Dec 1 2015 Jerry James <loganjerry@gmail.com> - 1.10-1
- New upstream version
- Update URLs
- Add -numpy patch to fix test failure
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.1-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

View File

@ -1,4 +1,4 @@
a2d9ee8427c5636426f319968e0af9f2 networkx-1.9.1.tar.gz
07c5c31b522c8195fa5123de45c84311 networkx_reference.pdf
fc244b2a697d87788d9bc51a5997a9af networkx_tutorial.pdf
83a7702ccc4031cc43f236a58d43ca67 networkx-documentation.zip
abce95ecda7b990cda39391f1d00bc43 networkx-1.10.tar.gz
1bc817b2b73c812f48619a284ed067d8 networkx_reference.pdf
9f3a3dc0fe5c32b23a47906a22a49bba networkx_tutorial.pdf
eab78caf7dfcb7833f5e45457c0f323a networkx-documentation.zip