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

Changed importlib_metadata to have requirement for < python 3.10 #577

Merged
merged 10 commits into from Jun 5, 2022
5 changes: 5 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,8 @@
v23.6.0
-------

* #575: Only require ``importlib_metadata`` on older Pythons.

v23.5.1
-------

Expand Down
7 changes: 4 additions & 3 deletions hook-keyring.backend.py
@@ -1,6 +1,7 @@
# Used by pyinstaller to expose hidden imports

import importlib_metadata as metadata
"""
Hook used by pyinstaller to expose hidden imports.
"""

from keyring.py310compat import metadata

hiddenimports = [ep.value for ep in metadata.entry_points(group='keyring.backends')]
3 changes: 1 addition & 2 deletions keyring/backend.py
Expand Up @@ -9,8 +9,7 @@

from typing import Optional

import importlib_metadata as metadata

from .py310compat import metadata
from . import credentials, errors, util
from .util import properties

Expand Down
10 changes: 10 additions & 0 deletions keyring/py310compat.py
@@ -0,0 +1,10 @@
import sys


__all__ = ['metadata']


if sys.version_info > (3, 10):
import importlib.metadata as metadata
else:
import importlib_metadata as metadata # type: ignore
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -23,7 +23,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.10"

[options.packages.find]
exclude =
Expand Down
3 changes: 1 addition & 2 deletions tests/test_packaging.py
@@ -1,6 +1,5 @@
import importlib_metadata as metadata

from keyring import backend
from keyring.py310compat import metadata


def test_entry_point():
Expand Down