mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-10 19:57:17 +03:00
Revert "Use importlib_metadata for entry points"
This reverts commit 9f071f5c40
.
This commit is contained in:
parent
d82eaf5420
commit
02e12a17ec
|
@ -11,7 +11,6 @@ numpy>=1.15.0
|
|||
requests>=2.13.0,<3.0.0
|
||||
plac<1.0.0,>=0.9.6
|
||||
pathlib==1.0.1; python_version < "3.4"
|
||||
importlib_metadata>=0.23; python_version < "3.8"
|
||||
# Optional dependencies
|
||||
jsonschema>=2.6.0,<3.1.0
|
||||
# Development dependencies
|
||||
|
|
|
@ -50,7 +50,6 @@ install_requires =
|
|||
wasabi>=0.2.0,<1.1.0
|
||||
srsly>=0.1.0,<1.1.0
|
||||
pathlib==1.0.1; python_version < "3.4"
|
||||
importlib_metadata>=0.23; python_version < "3.8"
|
||||
|
||||
[options.extras_require]
|
||||
lookups =
|
||||
|
|
|
@ -35,11 +35,6 @@ try:
|
|||
except ImportError:
|
||||
cupy = None
|
||||
|
||||
try: # Python 3.8
|
||||
import importlib.metadata as importlib_metadata
|
||||
except ImportError:
|
||||
import importlib_metadata # noqa: F401
|
||||
|
||||
try:
|
||||
from thinc.neural.optimizers import Optimizer # noqa: F401
|
||||
except ImportError:
|
||||
|
|
|
@ -27,7 +27,7 @@ except ImportError:
|
|||
|
||||
from .symbols import ORTH
|
||||
from .compat import cupy, CudaStream, path2str, basestring_, unicode_
|
||||
from .compat import import_file, importlib_metadata
|
||||
from .compat import import_file
|
||||
from .errors import Errors, Warnings, deprecation_warning
|
||||
|
||||
|
||||
|
@ -283,8 +283,7 @@ def get_entry_points(key):
|
|||
RETURNS (dict): Entry points, keyed by name.
|
||||
"""
|
||||
result = {}
|
||||
eps = importlib_metadata.entry_points()
|
||||
for entry_point in eps.get(key, []):
|
||||
for entry_point in pkg_resources.iter_entry_points(key):
|
||||
result[entry_point.name] = entry_point.load()
|
||||
return result
|
||||
|
||||
|
@ -298,8 +297,7 @@ def get_entry_point(key, value, default=None):
|
|||
default: Optional default value to return.
|
||||
RETURNS: The loaded entry point or None.
|
||||
"""
|
||||
eps = importlib_metadata.entry_points()
|
||||
for entry_point in eps.get(key, []):
|
||||
for entry_point in pkg_resources.iter_entry_points(key):
|
||||
if entry_point.name == value:
|
||||
return entry_point.load()
|
||||
return default
|
||||
|
|
Loading…
Reference in New Issue
Block a user