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)
21
21
Which is just a shortcut to:
22
22
23
23
``` py
24
- import sys
25
- import jupyter_ydoc
24
+ import pkg_resources
26
25
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" )}
34
27
```
35
28
36
29
Or directly import them:
37
30
``` py
38
31
from jupyter_ydoc import YFile, YNotebook
39
32
```
40
33
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
42
35
following to your package's ` setup.cfg ` :
43
36
44
37
```
Original file line number Diff line number Diff line change 1
- import sys
1
+ import pkg_resources
2
2
3
3
from .ydoc import YFile , YNotebook # noqa
4
4
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" )}
13
6
14
7
__version__ = "0.1.1"
You can’t perform that action at this time.
0 commit comments