Skip to content

Commit

Permalink
increate importlib_metadata minimum version for python < 3.11
Browse files Browse the repository at this point in the history
importlib in the standard library (for python < 3.11) and
importlib_metadata (<4.11.4) return duplicate entry points in some cases.
This leads to duplication of extensions in entry_points.get_extensions.

remove use of importlib for python 3.10 and require
use of importlib_metadata >= 4.11.4 for python < 3.11

fixes issue #1254
  • Loading branch information
braingram committed Dec 6, 2022
1 parent 32b82b8 commit ca45f4d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The ASDF Standard is at v1.6.0

- Fix issue #1256, where ``enum`` could not be used on tagged objects. [#1257]
- Update minimum importlib_metadata version to 4.11.4 for python < 3.11 [#1260]

2.14.1 (2022-11-23)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion asdf/entry_points.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import warnings

if sys.version_info < (3, 10):
if sys.version_info < (3, 11):
from importlib_metadata import entry_points
else:
from importlib.metadata import entry_points
Expand Down
2 changes: 1 addition & 1 deletion asdf/tests/test_entry_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

if sys.version_info < (3, 10):
if sys.version_info < (3, 11):
import importlib_metadata as metadata
else:
import importlib.metadata as metadata
Expand Down
2 changes: 1 addition & 1 deletion asdf/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from . import constants

if sys.version_info < (3, 10):
if sys.version_info < (3, 11):
from importlib_metadata import packages_distributions
else:
from importlib.metadata import packages_distributions
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies = [
'asdf-transform-schemas >=0.2.2',
'asdf-unit-schemas >= 0.1.0',
'importlib_resources >=3; python_version <"3.9"',
'importlib-metadata >=3; python_version <"3.10"',
'importlib-metadata >=4.11.4; python_version <"3.11"',
'jmespath >=0.6.2',
'jsonschema >=4.0.1',
'numpy >=1.18',
Expand Down

0 comments on commit ca45f4d

Please sign in to comment.