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

Federated labextensions: package name logic #9320

Closed
martinRenou opened this issue Nov 12, 2020 · 1 comment · Fixed by #9326
Closed

Federated labextensions: package name logic #9320

martinRenou opened this issue Nov 12, 2020 · 1 comment · Fixed by #9326
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@martinRenou
Copy link
Member

Description

When using the federated labextension script, the logic for finding the package name fails if the directory contains e.g. a docs directory that is a valid Python module. find_packages will find the docs module and look for the _jupyter_labextension_paths function there.
https://github.com/jupyterlab/jupyterlab/blob/master/jupyterlab/federated_labextensions.py#L373-L381

Reproduce

  1. Make a docs directory that contains an __init__.py file in the extension
  2. Run jupyter labextension develop . in the root directory of the extension

Expected behavior

If I can suggest a slight change in the current logic, it looks to me that the package = find_packages()[0] could be more of a "fallback" solution for when the setup.py --name is not defined, instead of the other way around.

I can come up with a PR myself if this change would be ok:

  • first look for setup.py --name
  • if it fails, look for find_packages()[0]

Context

  • Operating System and version:
  • Browser and version:
  • JupyterLab version:
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here.
@jasongrout
Copy link
Contributor

I can come up with a PR myself if this change would be ok:

* first look for `setup.py --name`

* if it fails, look for `find_packages()[0]`

That sounds reasonable to me. Thanks!

@jasongrout jasongrout added this to the 3.0 milestone Nov 12, 2020
@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
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.

2 participants