Skip to content

Commit

Permalink
Revert "importlib_metadata remove deprecated entry point interfaces (#…
Browse files Browse the repository at this point in the history
…7785)"

This reverts commit a4545db.
  • Loading branch information
auvipy committed Oct 19, 2022
1 parent 43924e3 commit c8ea12d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
12 changes: 1 addition & 11 deletions celery/bin/celery.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Celery Command Line Interface."""
import os
import pathlib
import sys
import traceback

try:
Expand Down Expand Up @@ -76,16 +75,7 @@ def convert(self, value, param, ctx):
APP = App()


if sys.version_info >= (3, 10):
_PLUGINS = entry_points(group='celery.commands')
else:
try:
_PLUGINS = entry_points().get('celery.commands', [])
except AttributeError:
_PLUGINS = entry_points().select(group='celery.commands')


@with_plugins(_PLUGINS)
@with_plugins(entry_points().get('celery.commands', []))
@click.group(cls=DYMGroup, invoke_without_command=True)
@click.option('-A',
'--app',
Expand Down
9 changes: 1 addition & 8 deletions celery/utils/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,7 @@ def gen_task_name(app, name, module_name):


def load_extension_class_names(namespace):
if sys.version_info >= (3, 10):
_entry_points = entry_points(group=namespace)
else:
try:
_entry_points = entry_points().get(namespace, [])
except AttributeError:
_entry_points = entry_points().select(group=namespace)
for ep in _entry_points:
for ep in entry_points().get(namespace, []):
yield ep.name, ep.value


Expand Down
2 changes: 1 addition & 1 deletion requirements/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ click>=8.1.2,<9.0
click-didyoumean>=0.3.0
click-repl>=0.2.0
click-plugins>=1.1.1
importlib-metadata>=3.6; python_version < '3.8'
importlib-metadata>=1.4.0; python_version < '3.8'

0 comments on commit c8ea12d

Please sign in to comment.