[arch-commits] Commit in python-networkx/repos/community-any (5 files)

Eli Schwartz eschwartz at archlinux.org
Fri May 7 18:48:08 UTC 2021


    Date: Friday, May 7, 2021 @ 18:48:07
  Author: eschwartz
Revision: 928661

archrelease: copy trunk to community-any

Added:
  python-networkx/repos/community-any/0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch
    (from rev 928660, python-networkx/trunk/0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch)
  python-networkx/repos/community-any/0001-Updated-decorator-requirement-for-4718.patch
    (from rev 928660, python-networkx/trunk/0001-Updated-decorator-requirement-for-4718.patch)
  python-networkx/repos/community-any/PKGBUILD
    (from rev 928660, python-networkx/trunk/PKGBUILD)
Deleted:
  python-networkx/repos/community-any/0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch
  python-networkx/repos/community-any/PKGBUILD

-----------------------------------------------------------------+
 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch |  248 +++++-----
 0001-Updated-decorator-requirement-for-4718.patch               |   29 +
 PKGBUILD                                                        |   81 +--
 3 files changed, 198 insertions(+), 160 deletions(-)

Deleted: 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch
===================================================================
--- 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch	2021-05-07 18:47:32 UTC (rev 928660)
+++ 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch	2021-05-07 18:48:07 UTC (rev 928661)
@@ -1,124 +0,0 @@
-From 933d3241eb23d6857716810bedfaf56123111a6a Mon Sep 17 00:00:00 2001
-From: Dan Schult <dschult at colgate.edu>
-Date: Sat, 7 Jul 2018 14:07:58 -0400
-Subject: [PATCH] Fix StopIteration handling which breaks in python 3.7
-
-See #3046
----
-
-rebase against stable release
-
- .../algorithms/connectivity/edge_augmentation.py     | 12 +++++++++---
- networkx/algorithms/connectivity/edge_kcomponents.py |  2 +-
- networkx/algorithms/traversal/edgedfs.py             |  2 +-
- networkx/generators/classic.py                       |  2 ++
- networkx/readwrite/sparse6.py                        | 10 ++++++++--
- 5 files changed, 21 insertions(+), 7 deletions(-)
-
-diff --git a/networkx/algorithms/connectivity/edge_augmentation.py b/networkx/algorithms/connectivity/edge_augmentation.py
-index cd8c748f..21512d7c 100644
---- a/networkx/algorithms/connectivity/edge_augmentation.py
-+++ b/networkx/algorithms/connectivity/edge_augmentation.py
-@@ -813,7 +813,10 @@ def unconstrained_bridge_augmentation(G):
-         A2 = [tuple(leafs)]
-     else:
-         # Choose an arbitrary non-leaf root
--        root = next(n for n, d in T.degree() if d > 1)
-+        try:
-+            root = next(n for n, d in T.degree() if d > 1)
-+        except StopIteration:  # no nodes found with degree > 1
-+            return
-         # order the leaves of C by (induced directed) preorder
-         v2 = [n for n in nx.dfs_preorder_nodes(T, root) if T.degree(n) == 1]
-         # connecting first half of the leafs in pre-order to the second
-@@ -954,7 +957,10 @@ def weighted_bridge_augmentation(G, avail, weight=None):
-     #     nx.least_common_ancestor on the reversed Tree.
- 
-     # Pick an arbitrary leaf from C as the root
--    root = next(n for n in C.nodes() if C.degree(n) == 1)
-+    try:
-+        root = next(n for n, d in C.degree() if d == 1)
-+    except StopIteration:  # no nodes found with degree == 1
-+        return
-     # Root C into a tree TR by directing all edges away from the root
-     # Note in their paper T directs edges towards the root
-     TR = nx.dfs_tree(C, root)
-@@ -1230,7 +1236,7 @@ def greedy_k_edge_augmentation(G, k, avail=None, weight=None, seed=None):
- 
-     done = is_k_edge_connected(G, k)
-     if done:
--        raise StopIteration()
-+        return
-     if avail is None:
-         # all edges are available
-         avail_uv = list(complement_edges(G))
-diff --git a/networkx/algorithms/connectivity/edge_kcomponents.py b/networkx/algorithms/connectivity/edge_kcomponents.py
-index 37bf61dc..f9b4364c 100644
---- a/networkx/algorithms/connectivity/edge_kcomponents.py
-+++ b/networkx/algorithms/connectivity/edge_kcomponents.py
-@@ -573,7 +573,7 @@ def general_k_edge_subgraphs(G, k):
-     if G.number_of_nodes() < k:
-         for node in G.nodes():
-             yield G.subgraph([node]).copy()
--        raise StopIteration()
-+        return
- 
-     # Intermediate results
-     R0 = {G.subgraph(cc).copy() for cc in find_ccs(G)}
-diff --git a/networkx/algorithms/traversal/edgedfs.py b/networkx/algorithms/traversal/edgedfs.py
-index 5434057d..b9d442b6 100644
---- a/networkx/algorithms/traversal/edgedfs.py
-+++ b/networkx/algorithms/traversal/edgedfs.py
-@@ -152,7 +152,7 @@ def edge_dfs(G, source=None, orientation='original'):
-     """
-     nodes = list(G.nbunch_iter(source))
-     if not nodes:
--        raise StopIteration
-+        return
- 
-     kwds = {'data': False}
-     if G.is_multigraph():
-diff --git a/networkx/generators/classic.py b/networkx/generators/classic.py
-index 22741a37..10710db4 100644
---- a/networkx/generators/classic.py
-+++ b/networkx/generators/classic.py
-@@ -54,6 +54,8 @@ __all__ = ['balanced_tree',
- # -------------------------------------------------------------------
- 
- def _tree_edges(n, r):
-+    if n == 0:
-+        return
-     # helper function for trees
-     # yields edges in rooted tree at 0 with n nodes and branching ratio r
-     nodes = iter(range(n))
-diff --git a/networkx/readwrite/sparse6.py b/networkx/readwrite/sparse6.py
-index 00ccae60..6f404ca3 100644
---- a/networkx/readwrite/sparse6.py
-+++ b/networkx/readwrite/sparse6.py
-@@ -163,7 +163,10 @@ def from_sparse6_bytes(string):
- 
-         while 1:
-             if dLen < 1:
--                d = next(chunks)
-+                try:
-+                    d = next(chunks)
-+                except StopIteration:
-+                    return
-                 dLen = 6
-             dLen -= 1
-             b = (d >> dLen) & 1  # grab top remaining bit
-@@ -171,7 +174,10 @@ def from_sparse6_bytes(string):
-             x = d & ((1 << dLen) - 1)  # partially built up value of x
-             xLen = dLen		# how many bits included so far in x
-             while xLen < k:  # now grab full chunks until we have enough
--                d = next(chunks)
-+                try:
-+                    d = next(chunks)
-+                except StopIteration:
-+                    return
-                 dLen = 6
-                 x = (x << 6) + d
-                 xLen += 6
--- 
-2.18.0
-

Copied: python-networkx/repos/community-any/0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch (from rev 928660, python-networkx/trunk/0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch)
===================================================================
--- 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch	                        (rev 0)
+++ 0001-Fix-StopIteration-handling-which-breaks-in-python-3..patch	2021-05-07 18:48:07 UTC (rev 928661)
@@ -0,0 +1,124 @@
+From 933d3241eb23d6857716810bedfaf56123111a6a Mon Sep 17 00:00:00 2001
+From: Dan Schult <dschult at colgate.edu>
+Date: Sat, 7 Jul 2018 14:07:58 -0400
+Subject: [PATCH] Fix StopIteration handling which breaks in python 3.7
+
+See #3046
+---
+
+rebase against stable release
+
+ .../algorithms/connectivity/edge_augmentation.py     | 12 +++++++++---
+ networkx/algorithms/connectivity/edge_kcomponents.py |  2 +-
+ networkx/algorithms/traversal/edgedfs.py             |  2 +-
+ networkx/generators/classic.py                       |  2 ++
+ networkx/readwrite/sparse6.py                        | 10 ++++++++--
+ 5 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/networkx/algorithms/connectivity/edge_augmentation.py b/networkx/algorithms/connectivity/edge_augmentation.py
+index cd8c748f..21512d7c 100644
+--- a/networkx/algorithms/connectivity/edge_augmentation.py
++++ b/networkx/algorithms/connectivity/edge_augmentation.py
+@@ -813,7 +813,10 @@ def unconstrained_bridge_augmentation(G):
+         A2 = [tuple(leafs)]
+     else:
+         # Choose an arbitrary non-leaf root
+-        root = next(n for n, d in T.degree() if d > 1)
++        try:
++            root = next(n for n, d in T.degree() if d > 1)
++        except StopIteration:  # no nodes found with degree > 1
++            return
+         # order the leaves of C by (induced directed) preorder
+         v2 = [n for n in nx.dfs_preorder_nodes(T, root) if T.degree(n) == 1]
+         # connecting first half of the leafs in pre-order to the second
+@@ -954,7 +957,10 @@ def weighted_bridge_augmentation(G, avail, weight=None):
+     #     nx.least_common_ancestor on the reversed Tree.
+ 
+     # Pick an arbitrary leaf from C as the root
+-    root = next(n for n in C.nodes() if C.degree(n) == 1)
++    try:
++        root = next(n for n, d in C.degree() if d == 1)
++    except StopIteration:  # no nodes found with degree == 1
++        return
+     # Root C into a tree TR by directing all edges away from the root
+     # Note in their paper T directs edges towards the root
+     TR = nx.dfs_tree(C, root)
+@@ -1230,7 +1236,7 @@ def greedy_k_edge_augmentation(G, k, avail=None, weight=None, seed=None):
+ 
+     done = is_k_edge_connected(G, k)
+     if done:
+-        raise StopIteration()
++        return
+     if avail is None:
+         # all edges are available
+         avail_uv = list(complement_edges(G))
+diff --git a/networkx/algorithms/connectivity/edge_kcomponents.py b/networkx/algorithms/connectivity/edge_kcomponents.py
+index 37bf61dc..f9b4364c 100644
+--- a/networkx/algorithms/connectivity/edge_kcomponents.py
++++ b/networkx/algorithms/connectivity/edge_kcomponents.py
+@@ -573,7 +573,7 @@ def general_k_edge_subgraphs(G, k):
+     if G.number_of_nodes() < k:
+         for node in G.nodes():
+             yield G.subgraph([node]).copy()
+-        raise StopIteration()
++        return
+ 
+     # Intermediate results
+     R0 = {G.subgraph(cc).copy() for cc in find_ccs(G)}
+diff --git a/networkx/algorithms/traversal/edgedfs.py b/networkx/algorithms/traversal/edgedfs.py
+index 5434057d..b9d442b6 100644
+--- a/networkx/algorithms/traversal/edgedfs.py
++++ b/networkx/algorithms/traversal/edgedfs.py
+@@ -152,7 +152,7 @@ def edge_dfs(G, source=None, orientation='original'):
+     """
+     nodes = list(G.nbunch_iter(source))
+     if not nodes:
+-        raise StopIteration
++        return
+ 
+     kwds = {'data': False}
+     if G.is_multigraph():
+diff --git a/networkx/generators/classic.py b/networkx/generators/classic.py
+index 22741a37..10710db4 100644
+--- a/networkx/generators/classic.py
++++ b/networkx/generators/classic.py
+@@ -54,6 +54,8 @@ __all__ = ['balanced_tree',
+ # -------------------------------------------------------------------
+ 
+ def _tree_edges(n, r):
++    if n == 0:
++        return
+     # helper function for trees
+     # yields edges in rooted tree at 0 with n nodes and branching ratio r
+     nodes = iter(range(n))
+diff --git a/networkx/readwrite/sparse6.py b/networkx/readwrite/sparse6.py
+index 00ccae60..6f404ca3 100644
+--- a/networkx/readwrite/sparse6.py
++++ b/networkx/readwrite/sparse6.py
+@@ -163,7 +163,10 @@ def from_sparse6_bytes(string):
+ 
+         while 1:
+             if dLen < 1:
+-                d = next(chunks)
++                try:
++                    d = next(chunks)
++                except StopIteration:
++                    return
+                 dLen = 6
+             dLen -= 1
+             b = (d >> dLen) & 1  # grab top remaining bit
+@@ -171,7 +174,10 @@ def from_sparse6_bytes(string):
+             x = d & ((1 << dLen) - 1)  # partially built up value of x
+             xLen = dLen		# how many bits included so far in x
+             while xLen < k:  # now grab full chunks until we have enough
+-                d = next(chunks)
++                try:
++                    d = next(chunks)
++                except StopIteration:
++                    return
+                 dLen = 6
+                 x = (x << 6) + d
+                 xLen += 6
+-- 
+2.18.0
+

Copied: python-networkx/repos/community-any/0001-Updated-decorator-requirement-for-4718.patch (from rev 928660, python-networkx/trunk/0001-Updated-decorator-requirement-for-4718.patch)
===================================================================
--- 0001-Updated-decorator-requirement-for-4718.patch	                        (rev 0)
+++ 0001-Updated-decorator-requirement-for-4718.patch	2021-05-07 18:48:07 UTC (rev 928661)
@@ -0,0 +1,29 @@
+From 2a472c4fab230394842f252abd033d9d3c69f0c0 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz at archlinux.org>
+Date: Fri, 7 May 2021 14:39:53 -0400
+Subject: [PATCH] Updated decorator requirement for #4718
+
+incompatible with decorator 5.0.0 through 5.0.6, fix pinned version
+by requiring >=5.0.7 (which we package) rather than 4.* which we don't
+
+See https://github.com/networkx/networkx/pull/4773
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index eb1521d7..3cad13f3 100644
+--- a/setup.py
++++ b/setup.py
+@@ -124,7 +124,7 @@ package_data = {
+     "networkx.utils": ["tests/*.py"],
+ }
+ 
+-install_requires = ["decorator>=4.3,<5"]
++install_requires = ["decorator>=5.0.7"]
+ extras_require = {
+     "all": [
+         "numpy",
+-- 
+2.31.1
+

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2021-05-07 18:47:32 UTC (rev 928660)
+++ PKGBUILD	2021-05-07 18:48:07 UTC (rev 928661)
@@ -1,36 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Clément DEMOULINS <clement at archivel.fr>
-
-pkgname=python-networkx
-pkgver=2.5.1
-pkgrel=1
-pkgdesc='Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.'
-arch=('any')
-license=('BSD')
-url="https://networkx.github.io"
-depends=('python-decorator')
-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.')
-makedepends=('python-setuptools')
-checkdepends=('python-pytest-runner')
-source=("https://github.com/networkx/networkx/archive/networkx-$pkgver.tar.gz")
-sha512sums=('0eb43aa9cedacb3e6dfa44703d300591ce5214e983d01e526f34105e0a565d49ef424c4c4232340b01b3e396a09ed44aee658bab0aa613edcba4d7b9b1aebe6a')
-
-build() {
-  cd networkx-networkx-$pkgver
-  python setup.py build
-}
-
-check() {
-  cd networkx-networkx-$pkgver
-  python setup.py pytest
-}
-
-package() {
-  cd networkx-networkx-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1
-  install -D -m 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
-  mv "$pkgdir"/usr/share/doc/networkx-$pkgver "$pkgdir"/usr/share/doc/$pkgname
-}

Copied: python-networkx/repos/community-any/PKGBUILD (from rev 928660, python-networkx/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2021-05-07 18:48:07 UTC (rev 928661)
@@ -0,0 +1,45 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Clément DEMOULINS <clement at archivel.fr>
+
+pkgname=python-networkx
+pkgver=2.5.1
+pkgrel=2
+pkgdesc='Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.'
+arch=('any')
+license=('BSD')
+url="https://networkx.github.io"
+depends=('python-decorator')
+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.')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest-runner')
+source=("https://github.com/networkx/networkx/archive/networkx-$pkgver.tar.gz"
+        "0001-Updated-decorator-requirement-for-4718.patch")
+sha512sums=('0eb43aa9cedacb3e6dfa44703d300591ce5214e983d01e526f34105e0a565d49ef424c4c4232340b01b3e396a09ed44aee658bab0aa613edcba4d7b9b1aebe6a'
+            '007e3dceb06f20ec7e2e492839e5d21d51966c6b6ae65d92140caebe97745b386ceebc8db6bdd4a8e27f807a7d158f42ddbaaeb2320e533567c19910ae1dd6e4')
+
+prepare() {
+  cd networkx-networkx-$pkgver
+
+  # https://github.com/networkx/networkx/pull/4773
+  patch -p1 -i ../0001-Updated-decorator-requirement-for-4718.patch
+}
+
+build() {
+  cd networkx-networkx-$pkgver
+  python setup.py build
+}
+
+check() {
+  cd networkx-networkx-$pkgver
+  python setup.py pytest
+}
+
+package() {
+  cd networkx-networkx-$pkgver
+  python setup.py install --root="$pkgdir" --optimize=1
+  install -D -m 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
+  mv "$pkgdir"/usr/share/doc/networkx-$pkgver "$pkgdir"/usr/share/doc/$pkgname
+}



More information about the arch-commits mailing list