The pds-github-util attempts to parse setup.py files with a simple regexp that looks for version= somewhere in the text. This won't work with the recently recommended approach for declarative package metadata that puts all the information into setup.cfg, and which we should move to.
But it won't work today with Versioneer, which we're now using with current and new Python repositories, including the template repository. This is because the version is a computed function, namely:
setup(
…
version=versioneer.get_version(),
…
)
which pds-github-util considers as version ersioneer.get_version(….
Instead, if possible, it should execute Python on setup.py with the version command and parse the output form the VCS dict. For example:
$ venv/bin/python setup.py version 2>/dev/null
running version
keywords are unexpanded, not using
got version from VCS {'version': '1.0.0.post0.dev18', 'full-revisionid': '3ce310983d7198b83ac0f05a5d2a3257ba52a206', 'dirty': True, 'error': None, 'date': '2021-06-08T13:33:18-0500'}
Version: 1.0.0.post0.dev18
full-revisionid: 3ce310983d7198b83ac0f05a5d2a3257ba52a206
dirty: True
date: 2021-06-08T13:33:18-0500
Here, the VCS dict has a version key which indicates what the version is.
The
pds-github-util
attempts to parsesetup.py
files with a simple regexp that looks forversion=
somewhere in the text. This won't work with the recently recommended approach for declarative package metadata that puts all the information intosetup.cfg
, and which we should move to.But it won't work today with Versioneer, which we're now using with current and new Python repositories, including the template repository. This is because the version is a computed function, namely:
which
pds-github-util
considers as versionersioneer.get_version(…
.Instead, if possible, it should execute Python on
setup.py
with theversion
command and parse the output form theVCS
dict. For example:Here, the VCS dict has a
version
key which indicates what the version is.