Skip to content

Commit fb22856

Browse files
committed
dev-python/networkx: Add from Gentoo
It's from Gentoo commit 122ebce35d3db79069ed3cdf59247dffcb74d92a.
1 parent b836b1d commit fb22856

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DIST networkx-3.4.2.tar.gz 2151368 BLAKE2B 10b18d7d5b80dd60342f65729688dd2a175c925c72f6e3d0aa4555f008acd347940d6f118a870ba02543d2dc451c4b91986fa834431cc8752b467c5b8622aa82 SHA512 910e1400ad18711761c715896c3238b9c7d8914c571ab4db3aaf18a772b5fef90e5378ca435fbfce55b5821f1ddd3863a3cd65030086e80a971df91d9203c637
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
3+
<pkgmetadata>
4+
<maintainer type="project">
5+
<email>[email protected]</email>
6+
<name>Python</name>
7+
</maintainer>
8+
<longdescription lang="en">
9+
NetworkX is a Python-based package for the creation, manipulation, and
10+
study of the structure, dynamics, and functions of complex networks.
11+
The structure of a graph or network is encoded in the edges (connections,
12+
links, ties, arcs, bonds) between nodes (vertices, sites, actors). If
13+
unqualified, by graph we mean a simple undirected graph, i.e. no
14+
self-loops and no multiple edges are allowed. By a network we usually
15+
mean a graph with weights (fields, properties) on nodes and/or edges.
16+
The potential audience for NetworkX includes: mathematicians, physicists,
17+
biologists, computer scientists, social scientists.
18+
</longdescription>
19+
<stabilize-allarches/>
20+
<upstream>
21+
<remote-id type="pypi">networkx</remote-id>
22+
<remote-id type="github">networkx/networkx</remote-id>
23+
</upstream>
24+
</pkgmetadata>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 1999-2024 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
DISTUTILS_USE_PEP517=setuptools
7+
PYTHON_FULLY_TESTED=( python3_{10..13} )
8+
PYTHON_COMPAT=( "${PYTHON_FULLY_TESTED[@]}" )
9+
10+
inherit distutils-r1 multiprocessing optfeature pypi virtualx
11+
12+
DESCRIPTION="Python tools to manipulate graphs and complex networks"
13+
HOMEPAGE="
14+
https://networkx.org/
15+
https://github.com/networkx/networkx/
16+
https://pypi.org/project/networkx/
17+
"
18+
19+
LICENSE="BSD"
20+
SLOT="0"
21+
KEYWORDS="amd64 arm arm64 ~loong ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
22+
23+
BDEPEND="
24+
test? (
25+
>=dev-python/lxml-4.6[${PYTHON_USEDEP}]
26+
dev-python/pytest-xdist[${PYTHON_USEDEP}]
27+
$(python_gen_cond_dep '
28+
>=dev-python/matplotlib-3.7[${PYTHON_USEDEP}]
29+
>=dev-python/numpy-1.24[${PYTHON_USEDEP}]
30+
>=dev-python/scipy-1.11.2[${PYTHON_USEDEP}]
31+
' "${PYTHON_FULLY_TESTED[@]}")
32+
)
33+
"
34+
35+
distutils_enable_tests pytest
36+
37+
src_test() {
38+
virtx distutils-r1_src_test
39+
}
40+
41+
python_test() {
42+
if use x86 ; then
43+
EPYTEST_DESELECT+=(
44+
# https://github.com/networkx/networkx/issues/5913 (bug #921958)
45+
networkx/algorithms/approximation/tests/test_traveling_salesman.py::test_asadpour_tsp
46+
)
47+
fi
48+
49+
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
50+
# virtx implies nonfatal
51+
nonfatal epytest -p xdist -n "$(makeopts_jobs)" --dist=worksteal || die
52+
}
53+
54+
src_install() {
55+
distutils-r1_src_install
56+
# those examples use various assets and pre-compressed files
57+
docompress -x /usr/share/doc/${PF}/examples
58+
}
59+
60+
pkg_postinst() {
61+
optfeature "recommended dependencies" "dev-python/matplotlib dev-python/numpy dev-python/pandas dev-python/scipy"
62+
optfeature "graph drawing and graph layout algorithms" "dev-python/pygraphviz dev-python/pydot"
63+
optfeature "YAML format reading and writing" "dev-python/pyyaml"
64+
optfeature "shapefile format reading and writing" "sci-libs/gdal[python]"
65+
optfeature "GraphML XML format" "dev-python/lxml"
66+
}

0 commit comments

Comments
 (0)