Skip to content

Commit

Permalink
Fix entry points handling on 3.8, which does not have EntryPoint.module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jun 28, 2023
1 parent ff36b88 commit 65fd05b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def read_file(*path):
setup_requires=[
],
install_requires=[
# PyPA standard version and requirement handling.
'packaging',
'perfmetrics >= 3.0.0',
'zope.interface',
'zope.dottedname',
Expand Down
7 changes: 5 additions & 2 deletions src/relstorage/tests/test_zodburi.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,16 @@ def _check_entry_point(self, name, cls, helper_cls):
module="relstorage.zodburi_resolver",
name=name,)
else:
# Prior to 3.10, we have to do this all manually.
# Prior to 3.10, we have to do this all manually (keyword selection
# was introduced in 3.10). Prior to 3.9, there is no ``.module`` attribute,
# so we have to look at the entire ``.value``.
#
ep_dict = entry_points()
entry_point, = (
ep
for ep
in ep_dict['zodburi.resolvers']
if ep.name == name and ep.module == 'relstorage.zodburi_resolver'
if ep.name == name and ep.value.startswith('relstorage.zodburi_resolver:')
)

target = entry_point.load()
Expand Down

0 comments on commit 65fd05b

Please sign in to comment.