Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use poetry version command to bump package version #1

Closed
philipschoemig opened this issue Jul 9, 2020 · 0 comments
Closed

Use poetry version command to bump package version #1

philipschoemig opened this issue Jul 9, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@philipschoemig
Copy link
Owner

philipschoemig commented Jul 9, 2020

Instead of using an external tool like bump2version the poetry command version could be used to increase the package version. For this to work the duplicate version information in src/bertlv/init.py and docs/conf.py must be removed.

init.py

The version variable could be assigned to the package version retrieved from importlib.metadata.version() as suggested in poetry issue #144. Example code:

try:
    import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
    import importlib_metadata

__version__ = importlib_metadata.version(__name__)

See the complete solution in this comment: python-poetry/poetry#2366 (comment)

However, for python version <3.8 this would introduce a dependency to importlib_metadata.

conf.py

The version should be retrieved by accessing the __version__ variable from the bertlv module. Example code:

import bertlv
version = bertlv.__version__
@philipschoemig philipschoemig added the enhancement New feature or request label Jul 9, 2020
@philipschoemig philipschoemig self-assigned this Jul 9, 2020
@philipschoemig philipschoemig changed the title Improvement: Use poetry version command to bump package version Use poetry version command to bump package version Aug 7, 2020
philipschoemig pushed a commit that referenced this issue Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant