You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, poetry version <version> not a bumping version of the __init__.py's __version__. this is discussed many times, and a workaround exists.
But, current work-around, using importlib.metadata.version() seem overkill for me.
This is the minimum approach of the crazy idea using astor #1354.
details
in poetry new.
generate _version.py (or __version__.py ?)
generated __init__.py reference it
in poetry version <version>
bump version of pyproject.toml
if _version.py exists, regenerate _version.py
That's all.
examples
_version.py
# (the comment, something like "this is auto generated file")__version__="0.1.0"
using importlib.metadata.version() is not a workaround. It is the solution, because it reads the metadata that were installed. Since python 3.8 this is also build-in in python. So you get this method for free, without any additional dependencies.
Yes, I know using importlib.metadata.version() can solve this problem.
This is just an implementation detail, but when loading a package created by poetry, each of this for-loop to get the package costs a bit with a huge virtualenv.
In this PR, the output of version information to the source code is stopped.
I like this. The version info in the package is out of poetry's Responsibilities.
I read #144 and #2614 (comment)
Feature Request
First of all,
poetry version <version>
not a bumping version of the__init__.py
's__version__
. this is discussed many times, and a workaround exists.But, current work-around, using
importlib.metadata.version()
seem overkill for me.This is the minimum approach of the crazy idea using astor #1354.
details
in
poetry new
._version.py
(or__version__.py
?)__init__.py
reference itin
poetry version <version>
pyproject.toml
_version.py
exists, regenerate_version.py
That's all.
examples
_version.py
init.py
The text was updated successfully, but these errors were encountered: