-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ServerApp to discover ExtensionApps (and their config). (#180)
* enable extensionapp config to be discoverable from serveapp * add some comments for future devs * allow None in non-ExtensionApp extensions * adjust tests to capture changes * minor bug fixes * renamed config pytest fixture * standardize extension loading mechanism * pass serverapp and extesnionapp to extensionapp handlers * use static url prefix for static paths * iniitalize all enabled extension, then load later * split extension initialization and loading * Upgrade examples to align on discovery branch * Polish examples * Launch example via python module * Avoid to run initialisation methods twice * Add main for simple_ext2 and simple_ext11 * minor changes to extension toggler * adding some comments throughout the code * move all CLI handling to the ServerApp * remove old traits from extensionapp * update tests * update tests with changes to extensionapp * fix examples entrypoint * add test dependency: pytest-lazy-fixture * unpin pytest * import lazyfixture directly due to changes in pytest * drop pytest-lazy-fixture * cleaner error handling in init_server_extension * minor clean up * minor fixes after review * add underscore as prefix to extension function * remove load_jupyter_server_extension from examples * minor typo in example comment Co-authored-by: Eric Charles <eric@datalayer.io>
- Loading branch information
Showing
36 changed files
with
840 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
c.SimpleApp1.configA = 'ConfigA from file' | ||
c.SimpleApp1.configB = 'ConfigB from file' | ||
c.SimpleApp1.configC = 'ConfigC from file' | ||
c.SimpleApp1.configD = 'ConfigD from file' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from .application import SimpleApp1 | ||
|
||
def _jupyter_server_extension_paths(): | ||
return [ | ||
{'module': 'simple_ext1'} | ||
] | ||
|
||
load_jupyter_server_extension = SimpleApp1.load_jupyter_server_extension | ||
def _jupyter_server_extension_paths(): | ||
return [{ | ||
'module': 'simple_ext1.application', | ||
'app': SimpleApp1 | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .application import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from .application import SimpleApp1 | ||
from .application import SimpleApp11 | ||
|
||
|
||
def _jupyter_server_extension_paths(): | ||
return [ | ||
{'module': 'simple_ext1'} | ||
] | ||
|
||
load_jupyter_server_extension = SimpleApp1.load_jupyter_server_extension | ||
{ | ||
'module': 'simple_ext11.application', | ||
'app': SimpleApp11 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .application import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from .application import SimpleApp2 | ||
|
||
|
||
def _jupyter_server_extension_paths(): | ||
return [ | ||
{'module': 'simple_ext2'}, | ||
] | ||
|
||
load_jupyter_server_extension = SimpleApp2.load_jupyter_server_extension | ||
{ | ||
'module': 'simple_ext2.application', | ||
'app': SimpleApp2 | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .application import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.