Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom apps to reuse build system #6989

Closed
vidartf opened this issue Aug 12, 2019 · 4 comments · Fixed by #7079
Closed

Allow custom apps to reuse build system #6989

vidartf opened this issue Aug 12, 2019 · 4 comments · Fixed by #7079
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@vidartf
Copy link
Member

vidartf commented Aug 12, 2019

I've recently been experimenting with creating a custom lab app (https://github/com/vidartf/phoila). Mostly, I found the system to be configurable (some bits more easily than others), but the one bit I ended up having to monkey patch was _get_core_data. This function supplies the core configuration of the build, but is an internal function that is impossible to configure (it uses a hard-coded local path).

Would there be any disagreement to making this path configurable?

@vidartf
Copy link
Member Author

vidartf commented Aug 12, 2019

Would there be any disagreement to making this path configurable?

Note that the goal is for a custom app to provide its own base-set of extensions, replacing the list from lab. Simply exposing the path is therefore probably not the best solution, since it requires the custom app to rely on the internal implementation details of the build system (layout of core package.json, which recently changed in a patch release, c.f. #6938).

A more robust solution could be to have a CoreConfig object, where you can either request the lab default core data, or an empty one that you can add packages/extensions to.

Pros:

  • A formalized API that can be updated if the internal format changes.
  • Allows custom lab apps like described above to have a non-pinned dependency on lab.

Cons:

  • Another API to maintain.
  • If we expose too much on the API, we might end up limiting the changes that can be made to the internal format.

@blink1073
Copy link
Member

I agree with have a CoreConfig object that is only accessible by subclassing (not cli). It limits our user API while allowing for this use case.

@jasongrout
Copy link
Contributor

And to be clear, #6938 was in a minor alpha release, not a patch release.

@vidartf
Copy link
Member Author

vidartf commented Aug 12, 2019

Another point for custom apps: Currently the build system in commands.py includes a property sys_dir, that will always be the base lab app_dir. The way it is used means that the app_dir that is passed to the command is used for everything, except that installed extensions are gathered from both the passed app_dir, and sys_dir. The custom app will therefore always get any extensions installed into lab. Currently, this can only be overridden by setting the environment variable JUPYTERLAB_DIR, but this affects global state for the entire process (e.g. if you want your cutom app and lab side-by-side).

Some questions:

  • Is the behavior of sys_dir ever used (cannot be disproved, but if anyone knows of any cases, that would be useful)?
  • What would be a good way for a custom app to disable the use of sys_dir without affecting global process state?

@lock lock bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Oct 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants