File tree Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Expand file tree Collapse file tree 2 files changed +5
-19
lines changed Original file line number Diff line number Diff line change @@ -21,24 +21,17 @@ print(ydocs)
2121Which is just a shortcut to:
2222
2323``` py
24- import sys
25- import jupyter_ydoc
24+ import pkg_resources
2625
27- # See compatibility note on `group` keyword in https://docs.python.org/3/library/importlib.metadata.html#entry-points
28- if sys.version_info < (3 , 10 ):
29- from importlib_metadata import entry_points
30- else :
31- from importlib.metadata import entry_points
32-
33- ydocs = {ep.name: ep.load() for ep in entry_points(group = " jupyter_ydoc" )}
26+ ydocs = {ep.name: ep.load() for ep in pkg_resources.iter_entry_points(group = " jupyter_ydoc" )}
3427```
3528
3629Or directly import them:
3730``` py
3831from jupyter_ydoc import YFile, YNotebook
3932```
4033
41- The ` jupyter_ydoc ` entry point group can be populated with your own document , e.g. by adding the
34+ The ` " jupyter_ydoc" ` entry point group can be populated with your own documents , e.g. by adding the
4235following to your package's ` setup.cfg ` :
4336
4437```
Original file line number Diff line number Diff line change 1- import sys
1+ import pkg_resources
22
33from .ydoc import YFile , YNotebook # noqa
44
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" )}
5+ ydocs = {ep .name : ep .load () for ep in pkg_resources .iter_entry_points (group = "jupyter_ydoc" )}
136
147__version__ = "0.1.1"
You can’t perform that action at this time.
0 commit comments