You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jupyter book toc migrate _toc.yml
# but also
jupyter book --help
bug
I am consistently getting a stack dump ending with
File "/some/path/lib/python3.12/site-packages/click/core.py", line 1325, in get_help self.format_help(ctx, formatter) File "/some/path/lib/python3.12/site-packages/click/core.py", line 1358, in format_help self.format_options(ctx, formatter) File "/some/path/lib/python3.12/site-packages/click/core.py", line 1564, in format_options self.format_commands(ctx, formatter) File "/some/path/lib/python3.12/site-packages/click/core.py", line 1616, in format_commands for subcommand in self.list_commands(ctx): ^^^^^^^^^^^^^^^^^^^^^^^ File "/some/path/lib/python3.12/site-packages/jupyter_book/cli/pluggable.py", line 38, in list_commands subcommands.extend(get_entry_point_names(self._entry_point_group)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/some/path/lib/python3.12/site-packages/jupyter_book/cli/pluggable.py", line 13, in get_entry_point_names return [ep.name for ep in metadata.entry_points().get(group, [])] ^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'EntryPoints' object has no attribute 'get'
problem
obviously the command is having problems displaying its own help...?
note that running a valid command like jupyter book build . works fine
This appears to be because the SelectableGroups class, which implemented a dictionary-like interface for the result of entry_points is deprecated and was removed in Python 3.12.
Unfortunately I think these API changes are to be expected between 3.8 and 3.12, since importlib's metadata functionality was new in 3.8 and only considered to be provisional.
I would suggest either checking to see first if entry_points(group=group) gives an error, and if it does, fall back to the current implementation.
I can open a PR soon, although I'm not sure if the suggested fix would be to add this sort of edge case handling, or instead just update the whole project to 3.12 - it seems like from these lines there's some kind of handling of multiple versions.
Edit: From what I can tell, import importlib.metadata would only throw an error before Python 3.8, so those lines can probably be removed outright, since the project seems to require at least 3.9.
Describe the bug
context
When I do
jupyter book toc migrate _toc.yml # but also jupyter book --help
bug
I am consistently getting a stack dump ending with
problem
obviously the command is having problems displaying its own help...?
note that running a valid command like
jupyter book build .
works fineReproduce the bug
just run the above commands
List your environment
this is on MacOS sonoma 14.4.1
The text was updated successfully, but these errors were encountered: