Skip to content

Commit ab596a2

Browse files
jtpiodavidbrochart
authored andcommitted
Drop pkg_resources
1 parent 07c1040 commit ab596a2

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

jupyter_ydoc/__init__.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
import pkg_resources
1+
import sys
22

33
from .ydoc import YFile, YNotebook # noqa
44

5-
ydocs = {ep.name: ep.load() for ep in pkg_resources.iter_entry_points(group="jupyter_ydoc")}
5+
# See compatibility note on `group` keyword in
6+
# https://docs.python.org/3/library/importlib.metadata.html#entry-points
7+
if sys.version_info < (3, 10):
8+
from importlib_metadata import entry_points
9+
else:
10+
from importlib.metadata import entry_points
11+
12+
ydocs = {ep.name: ep.load() for ep in entry_points(group="jupyter_ydoc")}
613

714
__version__ = "0.2.0"

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ keywords = [
1616
"ypy",
1717
]
1818
dependencies = [
19+
"importlib_metadata >=3.6; python_version<\"3.10\"",
1920
"y-py >=0.5.3,<0.6.0",
2021
]
2122

0 commit comments

Comments
 (0)