Conversation
100% agree with this. IMO this module creates more confusion than it provides value, by at least one order of magniture. |
|
While I would love to get rid of the The point, and the source of the complication, is that we normally have a 3-digits version number fully aligned with the "C" erfa version, but, in case we need to do a wrapper only change, we need to add a fourth digit in our version number. This is documented in Lines 36 to 48 in 0480708 This logic is implemented in the If this is perceived as a big issue, I'm totally open to change the versioning scheme, as soon as all the @liberfa/pyerfa-maintainers agree. In this case, by the way, I would also kindly ask to include in the PR an update of the pyerfa/RELEASING.rst document with a proposal for the new versioning scheme and release procedure. |
The version of `pyerfa` is not written down in `pyproject.toml` but is instead generated with `setuptools_scm` at build time. This works well for normal users, but developers working on `pyerfa` are very likely to install the code in editable mode, which avoids the need to rebuild the package after every code change and therefore also skips generating a new version identifier. The `_dev` subpackage was meant to provide updated version identifiers at runtime, but that subpackage relied on `setuptools_scm`, which is just a build dependency and therefore not likely to be installed even in a development environment. This means that `pyerfa` was very likely to report an outdated version identifier despite all the code in `_dev`. Now the code that checks if `pyerfa` and `erfa` versions are consistent with each other has been moved from the `_dev` subpackage to `setup.py` and everything else related to `_dev` has been deleted. If `setuptools_scm` is installed then it can be invoked directly with `python -m setuptools_scm`, which produces the expected result unless there has been a new `erfa` release since the last `pyerfa` release, but that is a rare enough occurrance that keeping the `_dev` subpackage just for this reason was not worthwhile.
|
I moved the implementation of |
|
@avalentino, have you looked at the updated PR? |
Updated description
The version of
pyerfais not written down inpyproject.tomlbut is instead generated withsetuptools_scmat build time. This works well for normal users, but developers working onpyerfaare very likely to install the code in editable mode, which avoids the need to rebuild the package after every code change and therefore also skips generating a new version identifier. The_devsubpackage is meant to provide updated version identifiers at runtime, but that subpackage relies onsetuptools_scm, which is just a build dependency and therefore not likely to be installed even in a development environment. This means thatpyerfais very likely to report an outdated version identifier despite all the code in_dev, as demonstrated by the examples in the original description.In this PR I am moving the code in
_devthat checks the consistency ofpyerfaanderfaversions tosetup.pywhere it can be trusted to work becausesetup.pyis executed bysetuptoolsat build-time, sosetuptools_scmwill be available. I am removing everything else related to_dev.If
setuptools_scmdoes happen to be installed then it can be invoked directly withpython -m setuptools_scm, which does produce the correct output unless there has been a newerfarelease since the lastpyerfarelease. That is a rare enough occurrence that keeping_devaround just for that is not worthwhile.Original description
The version of
pyerfais not written down inpyproject.tomlbut is instead generated withsetuptools_scmat build time. This works well for normal users, but developers working onpyerfaare very likely to install the code in editable mode, which avoids the need to rebuild the package after every code change and therefore also skips generating a new version identifier. The_devsubpackage is meant to provide updated version identifiers at runtime, but that subpackage relies onsetuptools_scm, which is just a build dependency and therefore not likely to be installed even in a development environment. This means thatpyerfais very likely to report an outdated version identifier despite all the code in_dev. Consider the following shell session as an example:So all the code in
_devhas achieved exactly nothing. Explicitly installingsetuptools_scmallows_devto function as intended, but also makes it emit a warning:But if
setuptools_scmis installed it can be invoked directly:Direct invocation does not need
_devat all:And if
setuptools_scmis not installed then trying to invoke it does not silently produce an outdated result like_devdoes: