We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
importlib_metadata
Describe the bug The package declares an install_requires dependency on importlib_metadata >= 3.6, this however is not necessary for Python 3.8+: https://docs.python.org/3.8/library/importlib.metadata.html#
install_requires
importlib_metadata >= 3.6
Proposal
Change the package setup.py to not require importlib_metadata in Python 3.8+ and use conditional imports.
setup.py
Please let me know if you'd like a PR
diff --git a/hook-keyring.backend.py b/hook-keyring.backend.py index 16d4044..c453f21 100644 --- a/hook-keyring.backend.py +++ b/hook-keyring.backend.py @@ -1,6 +1,9 @@ # Used by pyinstaller to expose hidden imports -import importlib_metadata as metadata +try: + import importlib.metadata as metadata +except ImportError: + import importlib_metadata as metadata hiddenimports = [ep.value for ep in metadata.entry_points(group='keyring.backends')] diff --git a/keyring/backend.py b/keyring/backend.py index ee6b256..3041faf 100644 --- a/keyring/backend.py +++ b/keyring/backend.py @@ -9,7 +9,11 @@ import operator from typing import Optional -import importlib_metadata as metadata +try: + import importlib.metadata as metadata +except ImportError: + import importlib_metadata as metadata + from . import credentials, errors, util from .util import properties diff --git a/setup.cfg b/setup.cfg index aa82e2e..54e2ec6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ install_requires = pywin32-ctypes!=0.1.0,!=0.1.1; sys_platform=="win32" SecretStorage>=3.2; sys_platform=="linux" jeepney>=0.4.2; sys_platform=="linux" - importlib_metadata >= 3.6 + importlib_metadata >= 3.6; python_version < "3.8" setup_requires = setuptools_scm[toml] >= 3.4.1 [options.packages.find]
The text was updated successfully, but these errors were encountered:
Please look at closed issues, this was already discussed several times.
Keyring is using the new API which is not available in Python 3.8 or 3.9, see #503 (comment) for details.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
The package declares an
install_requires
dependency onimportlib_metadata >= 3.6
, this however is not necessary for Python 3.8+: https://docs.python.org/3.8/library/importlib.metadata.html#Proposal
Change the package
setup.py
to not requireimportlib_metadata
in Python 3.8+ and use conditional imports.Please let me know if you'd like a PR
The text was updated successfully, but these errors were encountered: