cedadev / nappy

NASA Ames Processing in PYthon (NAPPy) - a Python library for reading, writing and converting NASA Ames files.
BSD 3-Clause "New" or "Revised" License
9 stars 13 forks source link

Managing version updates with poetry #54

Open agstephens opened 2 years ago

agstephens commented 2 years ago

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,

git tag x.y.z
git push --tags

then put that version in the pyproject.toml file like

poetry version $(git describe --tags --abbrev=0)

and finally

poetry build

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

from importlib import metadata
__version__ = metadata.version("package-name")

in the main __init__.py file.

FObersteiner commented 2 years ago

forgot to add two things,