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

Proper project structure #13

Open
TheMythologist opened this issue Jan 24, 2023 · 2 comments
Open

Proper project structure #13

TheMythologist opened this issue Jan 24, 2023 · 2 comments
Assignees

Comments

@TheMythologist
Copy link
Owner

TheMythologist commented Jan 24, 2023

Currently blocked by the release of cx-freeze==6.14.0 (for customizing configurations in pyproject.toml)

@TheMythologist
Copy link
Owner Author

TheMythologist commented Jan 28, 2023

Single-sourcing via pyproject.toml is blocked by poetry
Reference: python-poetry/poetry#3332

@PabloEmidio
Copy link

Single-sourcing via pyproject.toml is blocked by poetry
Reference: python-poetry/poetry#3332

The poetry itself uses a work around to versioning single source of truth while managing metadata using poetry implementation
See:

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants