Skip to content

Conversation

@fcollonval
Copy link
Member

@fcollonval fcollonval commented Jul 13, 2021

Fixes #159
Fixes #167

The data files should not be conditionned on anything => jupyter packaging needs to be installed as setup dependencies.

@fcollonval
Copy link
Member Author

The real problem is the command jupyter labextension develop . --overwrite

It raises:

Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    raise e
  File "setup.py", line 9, in <module>
    from jupyter_packaging import get_data_files, npm_builder, wrap_installers
ModuleNotFoundError: No module named 'jupyter_packaging'
An error occured.
FileNotFoundError: The Python package `.` is not a valid package, it is missing the `setup.py` file.

as it calls command such python setup.py --name. So I think we need either jupyterlab to require jupyter-packaging or to mock it to succeed at handling the labextension develop.

@blink1073 @jtpio @krassowski what do you think?

@ktaletsk
Copy link

I would like to add that current changes in this PR also fix another issue for me: when trying to manually build python source archive and a wheel with python setup.py sdist bdist_wheel and then install from the wheel (pip install myextension-0.1.0-py3-none-any.whl) server- and labextensions are not getting installed.

On 3.0, this manual build process gives:

$ jupyter server extension list
Config dir: /home/jovyan/.jupyter

Config dir: /opt/conda/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.16 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK

Config dir: /usr/local/etc/jupyter

$ jupyter labextension list
JupyterLab v3.0.16

and on the fix/setup_py:

$ jupyter server extension list
Config dir: /home/jovyan/.jupyter

Config dir: /opt/conda/etc/jupyter
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.16 OK
    myextension enabled
    - Validating myextension...
      myextension 0.1.0 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK

Config dir: /usr/local/etc/jupyter

$ jupyter labextension list
JupyterLab v3.0.16
/opt/conda/share/jupyter/labextensions
        myextension v0.1.0 enabled OK (python, myextension)

Except if we are introspecting the name or version (eg jupyter lab build tools)
@fcollonval
Copy link
Member Author

fcollonval commented Jul 16, 2021

Here is a new version that raises an error when jupyter-packaging except when introspecting package name or version (what is used by some jupyter lab build commands).

I used logging to print the warning on stderr. So it is not blocking introspection that is catching stdout.

@fcollonval fcollonval marked this pull request as ready for review July 16, 2021 08:26
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@blink1073 blink1073 merged commit aa5338c into jupyterlab:3.0 Jul 16, 2021
@fcollonval fcollonval deleted the fix/setup_py branch July 16, 2021 12:46
@fcollonval
Copy link
Member Author

@ktaletsk @mlucool would you mind testing the latest version to check that it solves your issues?

@ktaletsk
Copy link

@fcollonval I confirm that it solves my issue, thank you for solving it!

@mlucool
Copy link

mlucool commented Jul 20, 2021

This works great - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup.py ignoring ImportErrors Installation will not work if assets are not found and jupyter-packaging is not installed

4 participants