File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 14
14
from typing import Dict , Pattern , Tuple
15
15
16
16
import babel
17
- import entrypoints
18
17
from packaging .version import parse as parse_version
19
18
19
+ # See compatibility note on `group` keyword in https://docs.python.org/3/library/importlib.metadata.html#entry-points
20
+ if sys .version_info < (3 , 10 ):
21
+ from importlib_metadata import entry_points
22
+ else :
23
+ from importlib .metadata import entry_points
24
+
20
25
# Entry points
21
26
JUPYTERLAB_LANGUAGEPACK_ENTRY = "jupyterlab.languagepack"
22
27
JUPYTERLAB_LOCALE_ENTRY = "jupyterlab.locale"
@@ -86,7 +91,7 @@ def _get_installed_language_pack_locales():
86
91
"""
87
92
data = {}
88
93
messages = []
89
- for entry_point in entrypoints . get_group_all ( JUPYTERLAB_LANGUAGEPACK_ENTRY ):
94
+ for entry_point in entry_points ( group = JUPYTERLAB_LANGUAGEPACK_ENTRY ):
90
95
try :
91
96
data [entry_point .name ] = os .path .dirname (entry_point .load ().__file__ )
92
97
except Exception :
@@ -115,7 +120,7 @@ def _get_installed_package_locales():
115
120
"""
116
121
data = {}
117
122
messages = []
118
- for entry_point in entrypoints . get_group_all ( JUPYTERLAB_LOCALE_ENTRY ):
123
+ for entry_point in entry_points ( group = JUPYTERLAB_LOCALE_ENTRY ):
119
124
try :
120
125
data [entry_point .name ] = os .path .dirname (entry_point .load ().__file__ )
121
126
except Exception :
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ packages = find:
36
36
python_requires = >=3.7
37
37
install_requires =
38
38
babel
39
- entrypoints>=0.2.2
39
+ importlib_metadata>=3.6 ; python_version<"3.10"
40
40
jinja2>=3.0.3
41
41
json5
42
42
jsonschema>=3.0.1
You can’t perform that action at this time.
0 commit comments