Skip to content

Commit e1bb155

Browse files
committed
fixes #1525
1 parent b8ad3a1 commit e1bb155

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

nbdev/doclinks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ def _build_lookup_table(strip_libs=None, incl_libs=None, skip_mods=None):
238238
strip_libs = L(strip_libs)
239239
if incl_libs is not None: incl_libs = (L(incl_libs)+strip_libs).unique()
240240
entries = {}
241-
# TODO: use new group param once 3.10 in min python
242-
eps = [o for o in entry_points() if o.group=='nbdev']
241+
try: eps = entry_points(group='nbdev')
242+
# Python 3.9 fallback - entry_points() doesn't accept group parameter
243+
except TypeError: eps = entry_points().get('nbdev', [])
244+
243245
for o in eps:
244246
if incl_libs is not None and o.dist.name not in incl_libs: continue
245247
try: entries[o.name] = _qual_syms(o.load())

nbs/api/05_doclinks.ipynb

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -604,15 +604,6 @@
604604
"test_eq(_re_backticks.findall('consecutive `foo``bar``baz`'), ['foo', 'bar', 'baz'])"
605605
]
606606
},
607-
{
608-
"cell_type": "code",
609-
"execution_count": null,
610-
"metadata": {},
611-
"outputs": [],
612-
"source": [
613-
"eps = entry_points()['nbdev']"
614-
]
615-
},
616607
{
617608
"cell_type": "code",
618609
"execution_count": null,
@@ -630,8 +621,10 @@
630621
" strip_libs = L(strip_libs)\n",
631622
" if incl_libs is not None: incl_libs = (L(incl_libs)+strip_libs).unique()\n",
632623
" entries = {}\n",
633-
" # TODO: use new group param once 3.10 in min python\n",
634-
" eps = [o for o in entry_points() if o.group=='nbdev']\n",
624+
" try: eps = entry_points(group='nbdev')\n",
625+
" # Python 3.9 fallback - entry_points() doesn't accept group parameter\n",
626+
" except TypeError: eps = entry_points().get('nbdev', [])\n",
627+
" \n",
635628
" for o in eps:\n",
636629
" if incl_libs is not None and o.dist.name not in incl_libs: continue\n",
637630
" try: entries[o.name] = _qual_syms(o.load())\n",
@@ -764,7 +757,7 @@
764757
"text/markdown": [
765758
"---\n",
766759
"\n",
767-
"[source](https://github.com/AnswerDotAI/nbdev/blob/main/nbdev/doclinks.py#L269){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
760+
"[source](https://github.com/AnswerDotAI/nbdev/blob/main/nbdev/doclinks.py#L273){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
768761
"\n",
769762
"### NbdevLookup.doc\n",
770763
"\n",
@@ -775,7 +768,7 @@
775768
"text/plain": [
776769
"---\n",
777770
"\n",
778-
"[source](https://github.com/AnswerDotAI/nbdev/blob/main/nbdev/doclinks.py#L269){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
771+
"[source](https://github.com/AnswerDotAI/nbdev/blob/main/nbdev/doclinks.py#L273){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
779772
"\n",
780773
"### NbdevLookup.doc\n",
781774
"\n",

0 commit comments

Comments
 (0)