github action would modify the remote of the repo, one would have to pull after the action completes. This might not be desirable under all circumstances.
importlib.metadata is a Py 3.8 feature. A < Py 3.8 alternative might be pkg_resources; pkg_resources.get_distribution("nappy").version
Consider a new approach for version updates and tagging (using CI):
As an illustration, in a poetry-managed package, I would set the git tag first,
then put that version in the pyproject.toml file like
and finally
to build the package. Put the poetry part in a github action and you have an automated workflow.
To correctly show the version number within the package, you put
in the main
__init__.py
file.