NetworkX (https://networkx.lanl.gov/) provides some pretty solid graph manipulation functions to python. ebuild attached. unfortunately relies on setuptools... I don't know enough about distutils to convert it back to plain distutils.
Created attachment 78391 [details] ebuild for dev-python/networkx-0.26
Created attachment 78392 [details] networkx-0.26.ebuild fixed plot dependency inconsistency
- ebuild header missing
- ebuild header missing¹ - LGPL is not a valid license, please have a look at /usr/portage/licenses - please don't add yet another no* use flag, they'll all need to be changed later [1] http://www.gentoo.org/proj/en/devrel/handbook/handbook.xml?part=2&chap=3
Created attachment 90612 [details] networkx-0.30.ebuild New ebuild submitted. Bumps version to 0.30, fixes header, changes bad use flag to "matplotlib". Adds graphviz useflag. Includes test.py in documentation install. This works for me, and passes all tests, but I do use a patched version of pydot. I'll attach the patch to the pydot ebuild bug #106983. It's from networkx's website.
NetworkX 0.31 has been released: Renaming to networkx-0.31.ebuild works fine. Also, pydot is in media-gfx (in sunrise): - graphviz? ( >=dev-python/pydot-0.9.10 )" + graphviz? ( >=media-gfx/pydot-0.9.10 )"
Created attachment 103749 [details] update of ebuild for networkx version 0.33 Two changes have been done: 1. Ebuild has been renamed from networkx-0.30.ebuild to networkx-0.33.ebuild 2. It seems pydot package is moved from dev-python to media-gfx category, so the dependency line has been changed apropriately.
New version 0.34 of networkx is released. Renaming existing ebuild to networkx-0.34.ebuild works fine.
New version 0.35.1 of networkx is released. Renaming existing networkx-0.33.ebuild to networkx-0.35.1.ebuild works fine.
*** Bug 230461 has been marked as a duplicate of this bug. ***
OK after a quick comparison this ebuild is a bit more complete than mine as it includes interesting use flags. I will need a bit of work though. At the moment the use flag just make sure you have package related to the functionality installed. If you have matplotlib on your computer, the functionality will be built even if you set -matplotlib which is a problem. For graphviz, according to the networkx web site you need graphviz and a python binding package to graphviz called pygraphviz. (https://networkx.lanl.gov/wiki/pygraphviz) Not sure if it would work just by making sure that graphviz is built with the python flag as the interface is likely to be different. I will combine the best of both ebuild and post a new draft version here. I will wait until we sort out the use flags before importing into the science overlay.
Created attachment 178531 [details] networkx-0.99.ebuild Could make ebuild simpler because of upstream improvements.
Now in portage. I disabled the graphviz and matplotlib use flags, since they were only recommendations, not actually necessary, and emerging pygraphviz and matplotlib is same work as enabling their respective use flags.