mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 10:51:55 +00:00
python-networkx: bump to 3.6.1
Changelog: https://networkx.org/documentation/stable/release/release_dev.html Minor release with new algorithms and bug fixes since 3.5. Add test.sh to verify graph creation, pathfinding, and topological sort. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
1b3be237a7
commit
c02972510a
@@ -6,11 +6,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=python-networkx
|
||||
PKG_VERSION:=3.5
|
||||
PKG_VERSION:=3.6.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PYPI_NAME:=networkx
|
||||
PKG_HASH:=d4c6f9cf81f52d69230866796b82afbccdec3db7ae4fbd1b65ea750feed50037
|
||||
PKG_HASH:=26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE.txt
|
||||
@@ -27,7 +27,7 @@ define Package/python3-networkx
|
||||
SUBMENU:=Python
|
||||
TITLE:=Creating and manipulating graphs and networks
|
||||
URL:=https://networkx.org/
|
||||
DEPENDS:=+python3-light +python3-uuid +python3-xml
|
||||
DEPENDS:=+python3-light +python3-logging +python3-uuid +python3-xml
|
||||
endef
|
||||
|
||||
define Package/python3-networkx/description
|
||||
|
||||
23
lang/python/python-networkx/test.sh
Executable file
23
lang/python/python-networkx/test.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
[ "$1" = python3-networkx ] || exit 0
|
||||
python3 - << 'EOF'
|
||||
import networkx
|
||||
assert networkx.__version__, "networkx version is empty"
|
||||
|
||||
import networkx as nx
|
||||
|
||||
G = nx.Graph()
|
||||
G.add_nodes_from([1, 2, 3, 4])
|
||||
G.add_edges_from([(1, 2), (2, 3), (3, 4)])
|
||||
|
||||
assert G.number_of_nodes() == 4
|
||||
assert G.number_of_edges() == 3
|
||||
assert nx.is_connected(G)
|
||||
|
||||
path = nx.shortest_path(G, source=1, target=4)
|
||||
assert path == [1, 2, 3, 4], f"unexpected path: {path}"
|
||||
|
||||
D = nx.DiGraph()
|
||||
D.add_edges_from([(1, 2), (2, 3)])
|
||||
assert list(nx.topological_sort(D)) == [1, 2, 3]
|
||||
EOF
|
||||
Reference in New Issue
Block a user