-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Proper project structure #13
Comments
Single-sourcing via |
The poetry itself uses a work around to versioning https://github.com/python-poetry/poetry/blob/master/src/poetry/__version__.py#L5 from poetry.utils._compat import metadata https://github.com/python-poetry/poetry/blob/master/src/poetry/__version__.py#L12-L16 # The metadata.version that we import for Python 3.7 is untyped, work around
# that.
version: Callable[[str], str] = metadata.version
__version__ = version("poetry") https://github.com/python-poetry/poetry/blob/master/src/poetry/utils/_compat.py#L18-L22 if sys.version_info < (3, 10):
# compatibility for python <3.10
import importlib_metadata as metadata
else:
from importlib import metadata This approach is also showed in the source link you've mentioned: https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ import sys
if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata
assert metadata.version('pip') == '1.2.0' |
pyproject.toml
should be the single source of truth, especially for package versioningCurrently blocked by the release of
cx-freeze==6.14.0
(for customizing configurations inpyproject.toml
)The text was updated successfully, but these errors were encountered: