Skip to content

Commit

Permalink
Merge pull request #49 from minrk/rm-forced-sorting
Browse files Browse the repository at this point in the history
Remove forced sorting of extensions
  • Loading branch information
blink1073 authored May 11, 2021
2 parents 783fbf6 + e9f0491 commit eabc840
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions nbclassic/nbserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,6 @@ def _link_jupyter_server_extension(serverapp):
manager = serverapp.extension_manager
logger = serverapp.log

# Hack that patches the enabled extensions list, prioritizing
# jupyter nbclassic. In the future, it would be much better
# to incorporate a dependency injection system in the
# Extension manager that allows extensions to list
# their dependency tree and sort that way.
def extensions(self):
"""Dictionary with extension package names as keys
and an ExtensionPackage objects as values.
"""
# Pop out the nbclassic extension to prepend
# this extension at the front of the sorted server extensions.
nb = self._extensions.get("nbclassic")
# Sort all other extensions alphabetically.
other_extensions = dict(sorted(self._extensions.items()))
# Build a new extensions dictionary, sorted with nbclassic first.
sorted_extensions = {"nbclassic": nb}
sorted_extensions.update(**other_extensions)
return sorted_extensions

manager.__class__.extensions = property(extensions)

# Look to see if nbclassic is enabled. if so,
# link the nbclassic extension here to load
# its config. Then, port its config to the serverapp
Expand Down

0 comments on commit eabc840

Please sign in to comment.