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