Skip to content

Managing version updates with poetry #54

@agstephens

Description

@agstephens

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions