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

Replaced pkg_resources with importlib.metadata #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

idahogray
Copy link
Contributor

Use of pkg_resources is discouraged in favor of importlib.resources
and importlib.metadata. importlib.metadata is used in this commit
to get the version string from the pyproject.toml package configuration.

This PR closes #22 in order to hopefully allow PyOxidizer to package the library.

Use of pkg_resources is discouraged in favor of importlib.resources
and importlib.metadata. importlib.metadata is used in this commit
to get the version string from the pyproject.toml package configuration.
@stefan6419846
Copy link

stefan6419846 commented Jun 6, 2023

This will break compatibility in

python = "^3.6"

as importlib.metadata is only available since Python 3.8. Older Python versions (like supported by this project) require using the backport in importlib-metadata.

@stefan6419846
Copy link

As already mentioned, just requiring importlib_metadata; python_version < "3.8" (or dropping Python < 3.8 completely) and writing

try:
    from importlib.metadata import version
except ImportError:
    # Python < 3.8
    from importlib_metadata import version

would fix this for every supported version since Python 3.6.

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

Successfully merging this pull request may close these issues.

Replace pkg_resources
3 participants