Page MenuHomeFreeBSD

New port: devel/py-cdg

Authored by jonathan on Jul 20 2017, 7:29 PM.
Referenced Files
Unknown Object (File)
Sat, Jul 13, 3:46 AM
Unknown Object (File)
Wed, Jul 3, 11:21 PM
Unknown Object (File)
Sun, Jun 23, 7:29 PM
Unknown Object (File)
Jun 7 2024, 7:03 AM
Unknown Object (File)
Jun 2 2024, 1:48 PM
Unknown Object (File)
May 28 2024, 4:16 AM
Unknown Object (File)
May 15 2024, 11:42 PM
Unknown Object (File)
May 13 2024, 7:35 PM


Group Reviewers
rP452495: New port: devel/py-cdg

Although it doesn't (yet) look like much, this is a Python library for
manipulating control- and data-flow graphs. The long-term goal is to
provide a language-agnostic data format for describing control-flow
graphs (including callgraphs) and data-flow graphs as an intermediate
representation between language-facing tools like LLVM and user-facing
tools like Cytoscape, Dot and (maybe someday) a better cscope.

Test Plan

portlint: OK (looks fine.)
testport: OK (poudriere: 0.1.3, amd64, no options, Python v2.7,

Diff Detail

No Lint Coverage
No Test Coverage
Build Status
Buildable 11334
Build 11699: arc lint + arc unit

Event Timeline

bdrewery edited reviewers, added: Python; removed: portmgr.
bdrewery added a subscriber: bdrewery.
bdrewery added inline comments.

This include doesn't seem needed

This revision now requires changes to proceed.Jul 20 2017, 10:41 PM
koobs added inline comments.

Should match (ideally short_description) as closely as possible within the context of portlint/COMMENT format compliance. ie, currently, Software callgraph manipulation

Update upstream description/short_description if the comment can be improved


Add LICENSE to upstream (along with any other files that should be in the sdist), so that LICENSE_FILE=${WRKSRC}/LICENSE can be added in the port.


'install_requires': ['networkx', 'nose', 'pygraphviz'], are listed in but are not referenced in RUN_DEPENDS

Also, its very unlikely nose is an install_requires (its only listed as a TEST_DEPENDS here). If it is a test only requirement (and a compulsory one at that), it can/should be listed in

Extra but non-compulsory requirements should be listed instead


There is no such FreeBSD port/packagenamepy-nosetests/pyXY-nosetests. The port name is py-nose, the package name is pyXY-nose.

If you intended to depend on nose script/binary name nosetests, then depending on a python binary without a version suffix requires that the port is 'concurrent safe', ie; installs *both* scriptname and scriptname-X.Y.

This only occurs with packages who's upstream code does this themselves, or ports that explicitly use USE_PYTHON=concurrent.

Even for ports/packages that install version-suffixed script names, it is not recommended to use a version-suffix-LESS scriptname (ie; nosetests), as the version of Python this script invokes can be changed at anytime after installation by the user.

One should explicitly either use scriptname-${PYTHON_VER}, or better in almost all circumstances, depend on the python-version-specific-package-name, like:



Use CHEESESHOP (PyPI) as the default MASTER_SITES for Python package ports unless there is an explicit and compelling reason to use another source (in this case GitHub).

An example of a legitimate (albeit temporary) reason is that important files (example: test/test data files) are not included in the source distribution (sdist) from PyPI, and so tests can't be run without using the github sources until upstream fixes the issue (adding the files/dirs to and re-uploading the sdist in a future version).


Given this package has a 'scripts': ['bin/cdg-dot'], (ie; provides an end-user usable script), the port should be made "concurrent safe". That is, all files it installs should be named uniquely so that multiple installations of the port for use with multiple python versions concurrently do not conflict. This can be done with USE_PYTHON=concurrent and verifying the pkg-plist contents (make makeplist)


Use do-test: instead, and the build target dependency is no longer requires (since test framework elements was added to ports infrastructure)


Correct (upstream, registered pypi name) name is cdg

koobs requested changes to this revision.Jul 22 2017, 5:24 AM

Thanks very much for the feedback: I learned a lot about Python packaging!

I've addressed the issues that mentioned locally but arcanist is currently segfaulting for me. Hopefully I'll manage to upload my fixes soon.

jonathan edited edge metadata.
  • New port: devel/py-cdg
  • Address comments in Phab review
koobs requested changes to this revision.Aug 11 2017, 10:41 AM

This looks much better :)

Please confirm this port passes (QA) by adding the following to TEST PLAN sections after testing:

portlint: OK (looks fine.)
testport: OK (poudriere: <versions>, <archs>, <options>, <python-versions> tested)
This revision now requires changes to proceed.Aug 11 2017, 10:41 AM

Shouldn't use/need ?= unless this is a master port

sunpoet added inline comments.

Please uncomment PKGNAMEPREFIX.

jonathan edited edge metadata.
  • Change an unnecessary '?=' to '='.
  • Uncomment PKGNAMEPREFIX as requested by sunpoet.
  • Update py-cdg to HEAD
jonathan marked 2 inline comments as done.

Ok, I think that addresses the last of the reviewer comments?

This revision was automatically updated to reflect the committed changes.