Skip to content

Commit

Permalink
Merge pull request #577 from probro27/main
Browse files Browse the repository at this point in the history
Changed importlib_metadata to have requirement for < python 3.10
  • Loading branch information
jaraco committed Jun 5, 2022
2 parents 6881569 + c2ccc05 commit d106359
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
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

0 comments on commit d106359

Please sign in to comment.