Date: Friday, April 18, 2014 @ 10:48:49 Author: fyan Revision: 109715
addpkg: python-networkx 1.8.1-3 Added: python-networkx/ python-networkx/repos/ python-networkx/trunk/ python-networkx/trunk/PKGBUILD python-networkx/trunk/python-3.4.patch ------------------+ PKGBUILD | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ python-3.4.patch | 24 +++++++++++++++++ 2 files changed, 95 insertions(+) Added: python-networkx/trunk/PKGBUILD =================================================================== --- python-networkx/trunk/PKGBUILD (rev 0) +++ python-networkx/trunk/PKGBUILD 2014-04-18 08:48:49 UTC (rev 109715) @@ -0,0 +1,71 @@ +# $Id$ +# Maintainer: Felix Yan <felixonm...@gmail.com> +# Contributor: Clément DEMOULINS <clem...@archivel.fr> + +pkgbase=python-networkx +pkgname=(python-networkx python2-networkx) +_pythonname=networkx +pkgver=1.8.1 +pkgrel=3 +pkgdesc='Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.' +arch=('any') +license=('BSD') +url="http://networkx.github.io" +makedepends=('python-setuptools' 'python2-setuptools') +checkdepends=('python-nose' 'python2-nose') +source=("https://github.com/networkx/networkx/archive/${_pythonname}-${pkgver}.tar.gz" + python-3.4.patch) +md5sums=('f7961b12b5db92109befa1d3de1b1e0e' + 'fb33088811cba7e6d959d8770990f018') + +prepare() { + cd ${_pythonname}-${_pythonname}-$pkgver + patch -p1 -i ../python-3.4.patch + + cd .. + cp -r ${_pythonname}-${_pythonname}-$pkgver{,-py2} +} + +build() { + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver" + python3 setup_egg.py build + + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver-py2" + python2 setup_egg.py build +} + +check() { + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver" + python3 setup_egg.py nosetests || true # Tests fail randomly + + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver-py2" + python2 setup_egg.py nosetests +} + +package_python-networkx() { + depends=('python') + optdepends=('python-numpy: Provides sparse matrix representation of graphs and many numerical scientific tools.' + 'python-scipy: Provides flexible drawing of graphs.' + 'python-pyparsing: Required for pydot, GML file reading.' + 'python-yaml: Required for YAML format reading and writing.') + + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver" + python3 setup_egg.py install --root="$pkgdir" --optimize=1 + install -D -m 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt" + mv "$pkgdir/usr/share/doc/${_pythonname}-$pkgver" "$pkgdir/usr/share/doc/$pkgname" +} + +package_python2-networkx() { + depends=('python2') + optdepends=('python2-numpy: Provides sparse matrix representation of graphs and many numerical scientific tools.' + 'python2-scipy: Provides flexible drawing of graphs.' + 'python2-pygraphviz: Provides graph drawing and graph layout algorithms.' + 'python2-pydot: Provides graph drawing and graph layout algorithms.' + 'python2-pyparsing: Required for pydot, GML file reading.' + 'python2-yaml: Required for YAML format reading and writing.') + + cd "$srcdir/${_pythonname}-${_pythonname}-$pkgver-py2" + python2 setup_egg.py install --root="$pkgdir" --optimize=1 + install -D -m 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt" + mv "$pkgdir/usr/share/doc/${_pythonname}-$pkgver" "$pkgdir/usr/share/doc/$pkgname" +} Property changes on: python-networkx/trunk/PKGBUILD ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Added: python-networkx/trunk/python-3.4.patch =================================================================== --- python-networkx/trunk/python-3.4.patch (rev 0) +++ python-networkx/trunk/python-3.4.patch 2014-04-18 08:48:49 UTC (rev 109715) @@ -0,0 +1,24 @@ +Description: Backport python3 fixes. +Author: Chuck Short <zul...@ubuntu.com> +Forwarded: Not needed +diff -Naurp networkx-1.8.1.orig/networkx/readwrite/nx_shp.py networkx-1.8.1/networkx/readwrite/nx_shp.py +--- networkx-1.8.1.orig/networkx/readwrite/nx_shp.py 2013-08-04 09:53:31.000000000 -0400 ++++ networkx-1.8.1/networkx/readwrite/nx_shp.py 2014-01-27 10:57:47.015239061 -0500 +@@ -154,7 +154,7 @@ def write_shp(G, outdir): + feature.SetGeometry(g) + if attributes != None: + # Loop through attributes, assigning data to each field +- for field, data in attributes.iteritems(): ++ for field, data in attributes.iter(): + feature.SetField(field, data) + lyr.CreateFeature(feature) + feature.Destroy() +@@ -189,7 +189,7 @@ def write_shp(G, outdir): + data = G.get_edge_data(*e) + g = netgeometry(e, data) + # Loop through attribute data in edges +- for key, data in e[2].iteritems(): ++ for key, data in e[2].iter(): + # Reject spatial data not required for attribute table + if (key != 'Json' and key != 'Wkt' and key != 'Wkb' + and key != 'ShpName'):