Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: python/importlib_metadata
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.11.0
Choose a base ref
...
head repository: python/importlib_metadata
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 3, 2023

  1. Copy the full SHA
    37113c2 View commit details
  2. Finalize

    jaraco committed Dec 3, 2023
    Copy the full SHA
    fb492e1 View commit details
Showing with 10 additions and 29 deletions.
  1. +9 −0 NEWS.rst
  2. +1 −29 importlib_metadata/__init__.py
9 changes: 9 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v7.0.0
======

Deprecations and Removals
-------------------------

- Removed EntryPoint access by numeric index (tuple behavior).


v6.11.0
=======

30 changes: 1 addition & 29 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@
NullFinder,
StrPath,
install,
pypy_partial,
)
from ._functools import method_cache, pass_none
from ._itertools import always_iterable, unique_everseen
@@ -128,34 +127,7 @@ def valid(line: str):
return line and not line.startswith('#')


class DeprecatedTuple:
"""
Provide subscript item access for backward compatibility.
>>> recwarn = getfixture('recwarn')
>>> ep = EntryPoint(name='name', value='value', group='group')
>>> ep[:]
('name', 'value', 'group')
>>> ep[0]
'name'
>>> len(recwarn)
1
"""

# Do not remove prior to 2023-05-01 or Python 3.13
_warn = functools.partial(
warnings.warn,
"EntryPoint tuple interface is deprecated. Access members by name.",
DeprecationWarning,
stacklevel=pypy_partial(2),
)

def __getitem__(self, item):
self._warn()
return self._key()[item]


class EntryPoint(DeprecatedTuple):
class EntryPoint:
"""An entry point as defined by Python packaging conventions.
See `the packaging docs on entry points