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

Package jupyter lab extension #245

Merged
merged 43 commits into from
Feb 18, 2021

Conversation

janjagusch
Copy link
Contributor

@janjagusch janjagusch commented Feb 10, 2021

Closes #233

You can now install the package and the JL extension through pip install -ve ..

This change is breaking, as you have to remove Python 3.5 support.

@welcome
Copy link

welcome bot commented Feb 10, 2021

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@manics
Copy link
Member

manics commented Feb 10, 2021

Thanks for looking into this! Just a warning that currently the extension claims to support JupyterLab 1, 2 and 3

"@jupyterlab/application": "^1.0.0 || ^2.0.0 || ^3.0.0",
"@jupyterlab/apputils": "^1.0.0 || ^2.0.0 || ^3.0.0",
"@jupyterlab/launcher": "^1.0.0 || ^2.0.0 || ^3.0.0"

I've previously converted an extension to support JupyterLab 2 and 3 but a lot of changes were required to ensure the extension could still be installed with JupyterLab 2. If we want to keep supporting JupygerLab 1, 2 and 3 this will require testing on all three. Alternatively we could drop 1 and maybe 2 but that will require agreement from everyone.

setup.py Outdated
Comment on lines 66 to 70
version=pkg_json["version"],
url=pkg_json["homepage"],
author=pkg_json["author"],
description=pkg_json["description"],
license=pkg_json["license"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The metadata between package.json and setup.py differs. Is this intended? If yes, I would hard code the original values here. Otherwise, I would suggest this approach, as it avoids redundancy.

Copy link
Member

Choose a reason for hiding this comment

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

I think it makes sense to not duplicate common metadata, but if there's currently a difference we should make an informed choice on which value to use and if necessary update the value in package.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have adjusted it to reflect the original values from setup.py.

Comment on lines +81 to +93
("share/jupyter/nbextensions/jupyter_server_proxy", glob("jupyter_server_proxy/static/*")),
(
"etc/jupyter/jupyter_notebook_config.d",
["jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json"],
),
(
"etc/jupyter/jupyter_server_config.d",
["jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json"],
),
(
"etc/jupyter/nbconfig/tree.d",
["jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json"],
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe that the data_files property here is redundant with the data_files_spec variable. However, I'm not super sure what it does, so I decided to keep both. If anybody knows if and how you can merge those two, please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

One way would be to move these to data_files_spec so it's all handled by jupyter-packaging. Although the format would be slightly different.

As an example: https://github.com/jupyter-server/jupyter-resource-usage/blob/ef909637344d97b84a650a0dbe4f0487fb403bb7/setup.py#L29-L48

Copy link
Contributor

@JanJaguschQC JanJaguschQC Feb 10, 2021

Choose a reason for hiding this comment

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

Thanks for the hint, @jtpio! I adjusted it in 280ce01 6981985. Could you maybe have another look, please?

Okay, tests fail (https://github.com/jupyterhub/jupyter-server-proxy/pull/245/checks?check_run_id=1872759879), so I messed something up here. I assume I have to reference that file name jupyter_server_proxy.json somewhere.

Fixed in 6981985. Reading the documentation of create_cmdclass helped. 😓

setup.py Show resolved Hide resolved
@janjagusch
Copy link
Contributor Author

janjagusch commented Feb 10, 2021

Thanks for looking into this! Just a warning that currently the extension claims to support JupyterLab 1, 2 and 3

"@jupyterlab/application": "^1.0.0 || ^2.0.0 || ^3.0.0",
"@jupyterlab/apputils": "^1.0.0 || ^2.0.0 || ^3.0.0",
"@jupyterlab/launcher": "^1.0.0 || ^2.0.0 || ^3.0.0"

I've previously converted an extension to support JupyterLab 2 and 3 but a lot of changes were required to ensure the extension could still be installed with JupyterLab 2. If we want to keep supporting JupygerLab 1, 2 and 3 this will require testing on all three. Alternatively we could drop 1 and maybe 2 but that will require agreement from everyone.

Thanks for your review! I tried to leave most of the code base untouched but I agree that JL 1 support might not be necessary anymore. Still, that is something the maintainers have to decide. Also, looking at the ci test I think the current master also doesn't test for different JL versions. So at least his PR does not decrease test coverage (at least besides removing 3.5 support).

@janjagusch janjagusch marked this pull request as ready for review February 10, 2021 10:27
Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

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

I've made a first pass through this, looks good so far! I'll need more time to try it out properly.

The test cases I'm thinking of are:

  1. Build a distributable package: python setup.py sdist bdist_wheel. This may behave differently from an editable install so should be tested
  2. Install the extension in separate test environments:
    a. pip install notebook jupyterlab=3.*, then install the extension wheel using pip install dist/*whl, check it installs instantly (i.e. no jupyterlab build step)
    b. pip install notebook jupyterlab=3.*, then install the extension sdist using pip install dist/*tar.gz, behaviour may depend on exactly how this is implemented. My expectation is that it installs instantly i.e. no jupyterlab build step since although this is a python source package the js assets should've been compiled into the sdist, this may not be the case though, either way it's worth knowing
    c. pip install notebook jupyterlab=2.*, then install the extension wheel using pip install dist/*whl (since this is JupyterLab 2 the lab extension will be ignored but the server and notebook extensions should be present), then install the lab extension the old way.
  3. Check the extension works in notebook and jupyterlab!

Sorry for this long process, it's based on my experience and pitfalls from converting another extension that had to support JupyterLab 2 and 3. I'll try and get to it, but if someone else has some free time and wants to sign off on this testing that'd be great!

The other thing worth checking is whether this the Python package can be built with JupyterLab2, if it's not we should update the docs for anyone developing locally

In case you're wondering how I know all this.... see https://github.com/manics/jupyter-offlinenotebook/blob/v0.2.1/.github/workflows/build.yml 😄

setup.py Outdated
packages=setuptools.find_packages(),
install_requires=['notebook', 'simpervisor>=0.4', 'aiohttp'],
python_requires='>=3.5',
install_requires=["jupyterlab~=3.0", "notebook", "simpervisor>=0.4", "aiohttp"],
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't force people to install both jupyterlab and notebook to use this extension. How about if we omit both of those, and instead just document which version(s) are supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 48eec72 and f3210df. I've decided to set the requirement to jupyterlab>=2 but consider that a placeholder until we know which versions should be supported.

I also had to install jupyterlab explicitly during the test actions. I hardcoded v3 there but maybe it would be nice to test in a matrix there (005c0aa and 419c1b7)

setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated
Comment on lines 66 to 70
version=pkg_json["version"],
url=pkg_json["homepage"],
author=pkg_json["author"],
description=pkg_json["description"],
license=pkg_json["license"],
Copy link
Member

Choose a reason for hiding this comment

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

I think it makes sense to not duplicate common metadata, but if there's currently a difference we should make an informed choice on which value to use and if necessary update the value in package.json.

@janjagusch
Copy link
Contributor Author

janjagusch commented Feb 11, 2021

I've made a first pass through this, looks good so far! I'll need more time to try it out properly.

The test cases I'm thinking of are:

  1. Build a distributable package: python setup.py sdist bdist_wheel. This may behave differently from an editable install so should be tested
  2. Install the extension in separate test environments:
    a. pip install notebook jupyterlab=3.*, then install the extension wheel using pip install dist/*whl, check it installs instantly (i.e. no jupyterlab build step)
    b. pip install notebook jupyterlab=3.*, then install the extension sdist using pip install dist/*tar.gz, behaviour may depend on exactly how this is implemented. My expectation is that it installs instantly i.e. no jupyterlab build step since although this is a python source package the js assets should've been compiled into the sdist, this may not be the case though, either way it's worth knowing
    c. pip install notebook jupyterlab=2.*, then install the extension wheel using pip install dist/*whl (since this is JupyterLab 2 the lab extension will be ignored but the server and notebook extensions should be present), then install the lab extension the old way.
  3. Check the extension works in notebook and jupyterlab!

Sorry for this long process, it's based on my experience and pitfalls from converting another extension that had to support JupyterLab 2 and 3. I'll try and get to it, but if someone else has some free time and wants to sign off on this testing that'd be great!

The other thing worth checking is whether this the Python package can be built with JupyterLab2, if it's not we should update the docs for anyone developing locally

In case you're wondering how I know all this.... see https://github.com/manics/jupyter-offlinenotebook/blob/v0.2.1/.github/workflows/build.yml 😄

  • Building the package works without issues
Details

$ python setup.py sdist bdist_wheel
running sdist
running jsdeps
Installing build dependencies with npm.  This may take a while...
> jlpm install
yarn install v1.21.1
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
success Already up-to-date.
$ jlpm run clean && jlpm run build:prod
yarn run v1.21.1
$ jlpm run clean:lib
$ rimraf lib tsconfig.tsbuildinfo
✨  Done in 1.14s.
yarn run v1.21.1
$ jlpm run build:lib && jlpm run build:labextension
$ tsc
$ jupyter labextension build .
Building extension in .

Compilation starting…


Compilation finished

asset remoteEntry.2d365ce1a6523013a839.js 6.24 KiB [emitted] [immutable] [minimized] (name: @jupyterlab/server-proxy)
asset 568.d13a843b2f37185335bf.js 5.31 KiB [emitted] [immutable] [minimized]
runtime modules 17.2 KiB 12 modules
built modules 13.6 KiB (javascript) 168 bytes (consume-shared) 42 bytes (share-init) [built]
  javascript modules 13.6 KiB
    modules by path ./style/*.css 624 bytes 2 modules
    modules by path ./node_modules/ 8.23 KiB 2 modules
    container entry 42 bytes [built] [code generated]
    ./lib/index.js 4.73 KiB [built] [code generated]
  consume-shared-module modules 168 bytes
    modules by path consume shared module (default) @jupyterlab/*.3 (singleton) 84 bytes
      consume shared module (default) @jupyterlab/launcher@^3.0.3 (singleton) 42 bytes [built] [code generated]
      consume shared module (default) @jupyterlab/apputils@^3.0.3 (singleton) 42 bytes [built] [code generated]
    consume shared module (default) @jupyterlab/application@^3.0.4 (singleton) 42 bytes [built] [code generated]
    consume shared module (default) @jupyterlab/coreutils@^5.0.2 (singleton) 42 bytes [built] [code generated]
  provide shared module (default) @jupyterlab/server-proxy@2.1.2 = ./lib/index.js 42 bytes [built] [code generated]
webpack 5.21.2 compiled successfully in 587 ms
✨  Done in 9.16s.
✨  Done in 12.55s.
> jlpm run build:prod
yarn run v1.21.1
$ jlpm run build:lib && jlpm run build:labextension
$ tsc
$ jupyter labextension build .
Building extension in .

Compilation starting…


Compilation finished

asset remoteEntry.2d365ce1a6523013a839.js 6.24 KiB [emitted] [immutable] [minimized] (name: @jupyterlab/server-proxy)
asset 568.d13a843b2f37185335bf.js 5.31 KiB [emitted] [immutable] [minimized]
runtime modules 17.2 KiB 12 modules
built modules 13.6 KiB (javascript) 168 bytes (consume-shared) 42 bytes (share-init) [built]
  javascript modules 13.6 KiB
    modules by path ./style/*.css 624 bytes 2 modules
    modules by path ./node_modules/ 8.23 KiB 2 modules
    container entry 42 bytes [built] [code generated]
    ./lib/index.js 4.73 KiB [built] [code generated]
  consume-shared-module modules 168 bytes
    modules by path consume shared module (default) @jupyterlab/*.3 (singleton) 84 bytes
      consume shared module (default) @jupyterlab/launcher@^3.0.3 (singleton) 42 bytes [built] [code generated]
      consume shared module (default) @jupyterlab/apputils@^3.0.3 (singleton) 42 bytes [built] [code generated]
    consume shared module (default) @jupyterlab/application@^3.0.4 (singleton) 42 bytes [built] [code generated]
    consume shared module (default) @jupyterlab/coreutils@^5.0.2 (singleton) 42 bytes [built] [code generated]
  provide shared module (default) @jupyterlab/server-proxy@2.1.2 = ./lib/index.js 42 bytes [built] [code generated]
webpack 5.21.2 compiled successfully in 555 ms
✨  Done in 8.54s.
running handle_files
running check
warning: check: missing meta-data: if 'author' supplied, 'author_email' should be supplied too

warning: WrappedCommand: standard file not found: should have one of README, README.txt, README.rst

running egg_info
writing jupyter_server_proxy.egg-info/PKG-INFO
writing dependency_links to jupyter_server_proxy.egg-info/dependency_links.txt
writing requirements to jupyter_server_proxy.egg-info/requires.txt
writing top-level names to jupyter_server_proxy.egg-info/top_level.txt
reading manifest file 'jupyter_server_proxy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'jupyter_server_proxy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
creating jupyter_server_proxy-2.1.2
creating jupyter_server_proxy-2.1.2/jupyter_server_proxy
creating jupyter_server_proxy-2.1.2/jupyter_server_proxy/etc
creating jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension
creating jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension/static
creating jupyter_server_proxy-2.1.2/jupyter_server_proxy/static
making hard links in jupyter_server_proxy-2.1.2...
hard linking LICENSE -> jupyter_server_proxy-2.1.2
hard linking setup.cfg -> jupyter_server_proxy-2.1.2
hard linking setup.py -> jupyter_server_proxy-2.1.2
hard linking jupyter_server_proxy/__init__.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/api.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/config.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/handlers.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/utils.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/websocket.py -> jupyter_server_proxy-2.1.2/jupyter_server_proxy
hard linking jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/etc
hard linking jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/etc
hard linking jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/etc
hard linking jupyter_server_proxy/labextension/package.json -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension
hard linking jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension/static
hard linking jupyter_server_proxy/labextension/static/remoteEntry.2d365ce1a6523013a839.js -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension/static
hard linking jupyter_server_proxy/labextension/static/style.js -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/labextension/static
hard linking jupyter_server_proxy/static/tree.js -> jupyter_server_proxy-2.1.2/jupyter_server_proxy/static
Creating tar archive
removing 'jupyter_server_proxy-2.1.2' (and everything under it)
running bdist_wheel
running build
running build_py
copying jupyter_server_proxy/labextension/package.json -> build/lib/jupyter_server_proxy/labextension
copying jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js -> build/lib/jupyter_server_proxy/labextension/static
copying jupyter_server_proxy/labextension/static/remoteEntry.2d365ce1a6523013a839.js -> build/lib/jupyter_server_proxy/labextension/static
copying jupyter_server_proxy/labextension/static/style.js -> build/lib/jupyter_server_proxy/labextension/static
installing to build/bdist.macosx-10.9-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.9-x86_64/wheel
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
copying build/lib/jupyter_server_proxy/config.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/etc
copying build/lib/jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/etc
copying build/lib/jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/etc
copying build/lib/jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/etc
copying build/lib/jupyter_server_proxy/handlers.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
copying build/lib/jupyter_server_proxy/__init__.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
copying build/lib/jupyter_server_proxy/api.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension
copying build/lib/jupyter_server_proxy/labextension/package.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension/static
copying build/lib/jupyter_server_proxy/labextension/static/style.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension/static
copying build/lib/jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension/static
copying build/lib/jupyter_server_proxy/labextension/static/remoteEntry.2d365ce1a6523013a839.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/labextension/static
copying build/lib/jupyter_server_proxy/utils.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/static
copying build/lib/jupyter_server_proxy/static/tree.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy/static
copying build/lib/jupyter_server_proxy/websocket.py -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy
running install_data
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy
copying jupyter_server_proxy/labextension/package.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static
copying jupyter_server_proxy/labextension/static/style.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static
copying jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static
copying jupyter_server_proxy/labextension/static/remoteEntry.2d365ce1a6523013a839.js -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_server_config.d
copying jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_server_config.d
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_notebook_config.d
copying jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_notebook_config.d
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/nbconfig
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/nbconfig/tree.d
copying jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json -> build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.data/data/etc/jupyter/nbconfig/tree.d
running install_egg_info
Copying jupyter_server_proxy.egg-info to build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2-py3.9.egg-info
running install_scripts
adding license file "LICENSE" (matched pattern "LICENSE")
creating build/bdist.macosx-10.9-x86_64/wheel/jupyter_server_proxy-2.1.2.dist-info/WHEEL
creating 'dist/jupyter_server_proxy-2.1.2-py3-none-any.whl' and adding 'build/bdist.macosx-10.9-x86_64/wheel' to it
adding 'jupyter_server_proxy/__init__.py'
adding 'jupyter_server_proxy/api.py'
adding 'jupyter_server_proxy/config.py'
adding 'jupyter_server_proxy/handlers.py'
adding 'jupyter_server_proxy/utils.py'
adding 'jupyter_server_proxy/websocket.py'
adding 'jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json'
adding 'jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json'
adding 'jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json'
adding 'jupyter_server_proxy/labextension/package.json'
adding 'jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js'
adding 'jupyter_server_proxy/labextension/static/remoteEntry.2d365ce1a6523013a839.js'
adding 'jupyter_server_proxy/labextension/static/style.js'
adding 'jupyter_server_proxy/static/tree.js'
adding 'jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_notebook_config.d/jupyter-server-proxy-notebookserverextension.json'
adding 'jupyter_server_proxy-2.1.2.data/data/etc/jupyter/jupyter_server_config.d/jupyter-server-proxy-jupyterserverextension.json'
adding 'jupyter_server_proxy-2.1.2.data/data/etc/jupyter/nbconfig/tree.d/jupyter-server-proxy-nbextension.json'
adding 'jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/package.json'
adding 'jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static/568.d13a843b2f37185335bf.js'
adding 'jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static/remoteEntry.2d365ce1a6523013a839.js'
adding 'jupyter_server_proxy-2.1.2.data/data/share/jupyter/labextensions/jupyter_server_proxy/static/style.js'
adding 'jupyter_server_proxy-2.1.2.dist-info/LICENSE'
adding 'jupyter_server_proxy-2.1.2.dist-info/METADATA'
adding 'jupyter_server_proxy-2.1.2.dist-info/WHEEL'
adding 'jupyter_server_proxy-2.1.2.dist-info/top_level.txt'
adding 'jupyter_server_proxy-2.1.2.dist-info/RECORD'
removing build/bdist.macosx-10.9-x86_64/wheel

  • Installing the .whl in a new env with jupyterlab=3 works and installs instantly (no JL build)
Details

pip install ./dist/jupyter_server_proxy-2.1.2-py3-none-any.whl
Processing ./dist/jupyter_server_proxy-2.1.2-py3-none-any.whl
Requirement already satisfied: jupyterlab~=3.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server-proxy==2.1.2) (3.0.7)
Collecting simpervisor>=0.4
  Using cached simpervisor-0.4-py3-none-any.whl (5.7 kB)
Requirement already satisfied: notebook in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server-proxy==2.1.2) (6.2.0)
Collecting aiohttp
  Using cached aiohttp-3.7.3-cp39-cp39-macosx_10_14_x86_64.whl (648 kB)
Requirement already satisfied: jupyter-server~=1.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.3.0)
Requirement already satisfied: jinja2>=2.10 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.11.3)
Requirement already satisfied: jupyter-core in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.7.1)
Requirement already satisfied: packaging in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.9)
Requirement already satisfied: tornado>=6.1.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.1)
Requirement already satisfied: ipython in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (7.20.0)
Requirement already satisfied: nbclassic~=0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.6)
Requirement already satisfied: jupyterlab-server~=2.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.2.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jinja2>=2.10->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.1.1)
Requirement already satisfied: anyio>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.1.0)
Requirement already satisfied: nbformat in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (5.1.2)
Requirement already satisfied: ipython-genutils in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.0)
Requirement already satisfied: Send2Trash in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.5.0)
Requirement already satisfied: jupyter-client>=6.1.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.1.11)
Requirement already satisfied: pyzmq>=17 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.0.0)
Requirement already satisfied: prometheus-client in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.2)
Requirement already satisfied: nbconvert in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.0.7)
Requirement already satisfied: traitlets>=4.2.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (5.0.5)
Requirement already satisfied: idna>=2.8 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from anyio>=2.0.2->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.10)
Requirement already satisfied: sniffio>=1.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from anyio>=2.0.2->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.2.0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyter-client>=6.1.1->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.8.1)
Requirement already satisfied: jsonschema>=3.0.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.2.0)
Requirement already satisfied: json5 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.5)
Requirement already satisfied: babel in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.9.0)
Requirement already satisfied: requests in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.25.1)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.3.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.17.3)
Requirement already satisfied: setuptools in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (49.6.0.post20210108)
Requirement already satisfied: six>=1.11.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.15.0)
Requirement already satisfied: argon2-cffi in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from notebook->jupyter-server-proxy==2.1.2) (20.1.0)
Requirement already satisfied: ipykernel in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from notebook->jupyter-server-proxy==2.1.2) (5.4.3)
Requirement already satisfied: ptyprocess in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from terminado>=0.8.3->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.7.0)
Collecting multidict<7.0,>=4.5
  Using cached multidict-5.1.0-cp39-cp39-macosx_10_14_x86_64.whl (49 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.6.3-cp39-cp39-macosx_10_14_x86_64.whl (124 kB)
Collecting chardet<4.0,>=2.0
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting typing-extensions>=3.6.5
  Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting async-timeout<4.0,>=3.0
  Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from argon2-cffi->notebook->jupyter-server-proxy==2.1.2) (1.14.4)
Requirement already satisfied: pycparser in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from cffi>=1.0.0->argon2-cffi->notebook->jupyter-server-proxy==2.1.2) (2.20)
Requirement already satisfied: pytz>=2015.7 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from babel->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2021.1)
Requirement already satisfied: appnope in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipykernel->notebook->jupyter-server-proxy==2.1.2) (0.1.2)
Requirement already satisfied: jedi>=0.16 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.18.0)
Requirement already satisfied: pickleshare in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.7.5)
Requirement already satisfied: decorator in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.4.2)
Requirement already satisfied: pexpect>4.3 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.8.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.0.14)
Requirement already satisfied: backcall in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.0)
Requirement already satisfied: pygments in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.7.4)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from jedi>=0.16->ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.8.1)
Requirement already satisfied: wcwidth in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.5)
Requirement already satisfied: bleach in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.3.0)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.8.4)
Requirement already satisfied: testpath in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.4.4)
Requirement already satisfied: jupyterlab-pygments in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.1.2)
Requirement already satisfied: defusedxml in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.6.0)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.4.2)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.3)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.5.2)
Requirement already satisfied: nest-asyncio in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.4.3)
Requirement already satisfied: async-generator in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.10)
Requirement already satisfied: webencodings in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from bleach->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.5.1)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from packaging->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.4.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.26.3)
Installing collected packages: chardet, multidict, yarl, typing-extensions, async-timeout, simpervisor, aiohttp, jupyter-server-proxy
  Attempting uninstall: chardet
    Found existing installation: chardet 4.0.0
    Uninstalling chardet-4.0.0:
      Successfully uninstalled chardet-4.0.0
Successfully installed aiohttp-3.7.3 async-timeout-3.0.1 chardet-3.0.4 jupyter-server-proxy-2.1.2 multidict-5.1.0 simpervisor-0.4 typing-extensions-3.7.4.3 yarl-1.6.3

  • Installing the .tar.gz in another new env with jupyterlab=3 requires jupyter-packaging and then fails with a FileNotFoundError (maybe I'm doing something wrong here)
Details

$ pip install ./dist/jupyter_server_proxy-2.1.2.tar.gz
Processing ./dist/jupyter_server_proxy-2.1.2.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3-tar/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-req-build-b0icjpdw/setup.py'"'"'; __file__='"'"'/private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-req-build-b0icjpdw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-pip-egg-info-ulp9tdsl
         cwd: /private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-req-build-b0icjpdw/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-req-build-b0icjpdw/setup.py", line 69, in <module>
        long_description = (HERE / "README.md").read_text()
      File "/usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3-tar/lib/python3.9/pathlib.py", line 1255, in read_text
        with self.open(mode='r', encoding=encoding, errors=errors) as f:
      File "/usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3-tar/lib/python3.9/pathlib.py", line 1241, in open
        return io.open(self, mode, buffering, encoding, errors, newline,
      File "/usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl3-tar/lib/python3.9/pathlib.py", line 1109, in _opener
        return self._accessor.open(self, flags, mode)
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/mj/2sx68gpn1bldjjpwtbqs8gfr0000gn/T/pip-req-build-b0icjpdw/README.md'
    ----------------------------------------
WARNING: Discarding file:///Users/janjagusch/Projects/personal/jupyter-server-proxy/dist/jupyter_server_proxy-2.1.2.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  • In another new env with jupyterlab=2 installing the .whl works but it installs jupyterlab=3 during the installation. I think we can avoid this by changing the install_requires to jupyterlab>=2.0. Update: After changing the setup.py locally and rebuilding the .whl the installation worked without issues.
Details

$ pip install ./dist/jupyter_server_proxy-2.1.2-py3-none-any.whl
Processing ./dist/jupyter_server_proxy-2.1.2-py3-none-any.whl
Requirement already satisfied: aiohttp in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server-proxy==2.1.2) (3.7.3)
Collecting jupyterlab~=3.0
  Using cached jupyterlab-3.0.7-py3-none-any.whl (8.3 MB)
Requirement already satisfied: notebook in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server-proxy==2.1.2) (6.2.0)
Requirement already satisfied: simpervisor>=0.4 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server-proxy==2.1.2) (0.4)
Requirement already satisfied: jinja2>=2.10 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.11.3)
Requirement already satisfied: nbclassic~=0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.6)
Requirement already satisfied: tornado>=6.1.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.1)
Requirement already satisfied: packaging in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.9)
Requirement already satisfied: jupyter-server~=1.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.3.0)
Requirement already satisfied: jupyter-core in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.7.1)
Requirement already satisfied: jupyterlab-server~=2.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.2.0)
Requirement already satisfied: ipython in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (7.20.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jinja2>=2.10->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.1.1)
Requirement already satisfied: nbformat in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (5.1.2)
Requirement already satisfied: nbconvert in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.0.7)
Requirement already satisfied: prometheus-client in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.0)
Requirement already satisfied: Send2Trash in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.5.0)
Requirement already satisfied: pyzmq>=17 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.0.0)
Requirement already satisfied: traitlets>=4.2.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (5.0.5)
Requirement already satisfied: jupyter-client>=6.1.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (6.1.11)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.2)
Requirement already satisfied: anyio>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.1.0)
Requirement already satisfied: ipython-genutils in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.0)
Requirement already satisfied: sniffio>=1.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from anyio>=2.0.2->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.2.0)
Requirement already satisfied: idna>=2.8 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from anyio>=2.0.2->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.10)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyter-client>=6.1.1->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.8.1)
Requirement already satisfied: babel in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.9.0)
Requirement already satisfied: json5 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.9.5)
Requirement already satisfied: jsonschema>=3.0.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.2.0)
Requirement already satisfied: requests in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.25.1)
Requirement already satisfied: six>=1.11.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.15.0)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (20.3.0)
Requirement already satisfied: setuptools in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (49.6.0.post20210108)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.17.3)
Requirement already satisfied: argon2-cffi in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from notebook->jupyter-server-proxy==2.1.2) (20.1.0)
Requirement already satisfied: ipykernel in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from notebook->jupyter-server-proxy==2.1.2) (5.4.3)
Requirement already satisfied: ptyprocess in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from terminado>=0.8.3->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.7.0)
Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from aiohttp->jupyter-server-proxy==2.1.2) (1.6.3)
Requirement already satisfied: typing-extensions>=3.6.5 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from aiohttp->jupyter-server-proxy==2.1.2) (3.7.4.3)
Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from aiohttp->jupyter-server-proxy==2.1.2) (5.1.0)
Requirement already satisfied: chardet<4.0,>=2.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from aiohttp->jupyter-server-proxy==2.1.2) (3.0.4)
Requirement already satisfied: async-timeout<4.0,>=3.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from aiohttp->jupyter-server-proxy==2.1.2) (3.0.1)
Requirement already satisfied: cffi>=1.0.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from argon2-cffi->notebook->jupyter-server-proxy==2.1.2) (1.14.4)
Requirement already satisfied: pycparser in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from cffi>=1.0.0->argon2-cffi->notebook->jupyter-server-proxy==2.1.2) (2.20)
Requirement already satisfied: pytz>=2015.7 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from babel->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2021.1)
Requirement already satisfied: appnope in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipykernel->notebook->jupyter-server-proxy==2.1.2) (0.1.2)
Requirement already satisfied: backcall in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.0)
Requirement already satisfied: pickleshare in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.7.5)
Requirement already satisfied: pygments in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.7.4)
Requirement already satisfied: jedi>=0.16 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.18.0)
Requirement already satisfied: pexpect>4.3 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.8.0)
Requirement already satisfied: decorator in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (4.4.2)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.0.14)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from jedi>=0.16->ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.8.1)
Requirement already satisfied: wcwidth in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.2.5)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.3)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.8.4)
Requirement already satisfied: testpath in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.4.4)
Requirement already satisfied: jupyterlab-pygments in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.1.2)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.4.2)
Requirement already satisfied: bleach in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (3.3.0)
Requirement already satisfied: defusedxml in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.6.0)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.5.2)
Requirement already satisfied: nest-asyncio in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.4.3)
Requirement already satisfied: async-generator in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.10)
Requirement already satisfied: webencodings in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from bleach->nbconvert->jupyter-server~=1.2->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (0.5.1)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from packaging->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2.4.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-jl2/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.0->jupyterlab~=3.0->jupyter-server-proxy==2.1.2) (1.26.3)
jupyter-server-proxy is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
Installing collected packages: jupyterlab
  Attempting uninstall: jupyterlab
    Found existing installation: jupyterlab 2.2.9
    Uninstalling jupyterlab-2.2.9:
      Successfully uninstalled jupyterlab-2.2.9
Successfully installed jupyterlab-3.0.7

So far, I've only tested the installation, not the functionality.

Update: Added a CI test that installs the package wheel for JL versions 1, 2 and 3 and runs the unit test afterwards.

@manics
Copy link
Member

manics commented Feb 16, 2021

The notebook menu item is fixed.

There's no harm in having more tests if you can see an easy way to add it 😄. In case it's useful this is the bit of code called by jupyter nbextension list: https://github.com/jupyter/notebook/blob/18e4834b12c147f6472a5dfcd6e33345858fd1bb/notebook/nbextensions.py#L917-L952

In [1]: from notebook.nbextensions import ListNBExtensionsApp

In [2]: ListNBExtensionsApp().start()
Known nbextensions:
  config dir: /home/j/v/etc/jupyter/nbconfig
    tree section
      jupyter_server_proxy/tree  enabled 
      - Validating: OK

Unfortunately the JupyterLab icon for http-proxy is missing when this is pip installed. This is what it should look like in the current released extension:
image

@jtpio
Copy link
Contributor

jtpio commented Feb 16, 2021

We might want to add a build-requires somewhere to indicate jupyter_packaging and jupyterlab are required for running setup.py. Not sure if that can be done in setup.py though, I used pyproject.toml in https://github.com/manics/jupyter-offlinenotebook/blob/0a23403bf32399e0a16a8b8cedae8070300465b6/pyproject.toml but I think that can cause other problems. @jtpio Do you know what's best? Should we just document it instead of trying to automate it in the build system?

Yes, this is what the cookiecutter does too:

https://github.com/jupyterlab/extension-cookiecutter-ts/blob/a161a92deee694d42f52a9769ff76bacc969175f/%7B%7Bcookiecutter.python_name%7D%7D/pyproject.toml#L2

@JanJaguschQC
Copy link
Contributor

We might want to add a build-requires somewhere to indicate jupyter_packaging and jupyterlab are required for running setup.py. Not sure if that can be done in setup.py though, I used pyproject.toml in https://github.com/manics/jupyter-offlinenotebook/blob/0a23403bf32399e0a16a8b8cedae8070300465b6/pyproject.toml but I think that can cause other problems. @jtpio Do you know what's best? Should we just document it instead of trying to automate it in the build system?

Yes, this is what the cookiecutter does too:

https://github.com/jupyterlab/extension-cookiecutter-ts/blob/a161a92deee694d42f52a9769ff76bacc969175f/%7B%7Bcookiecutter.python_name%7D%7D/pyproject.toml#L2

Cool! Done in 71d758e.

@janjagusch
Copy link
Contributor Author

Unfortunately the JupyterLab icon for http-proxy is missing when this is pip installed. This is what it should look like in the current released extension:

@manics, not sure yet what might be the reason. I was hoping for jupyter labextension list to indicate something is wrong but that's unfortunately not the case.

$ jupyter labextension list
JupyterLab v3.0.7
/usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/share/jupyter/labextensions
        @jupyterlab/server-proxy v3.0.0-rc.1 enabled OK

jupyter nbextension list
Known nbextensions:
  config dir: /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/etc/jupyter/nbconfig
    tree section
      jupyter_server_proxy/tree  enabled
      - Validating: OK

I will investigate.

@JanJaguschQC
Copy link
Contributor

Unfortunately the JupyterLab icon for http-proxy is missing when this is pip installed. This is what it should look like in the current released extension

Not sure yet what can cause this but here are some steps to reproduce:

Evidence that latest jupyter-server-proxy release shows proxy icon in JL.

$ conda create -n jupyter-server-proxy-new jupyterlab
$ conda activate jupyter-server-proxy-new
$ conda install jupyter-server-proxy
$ echo "c.ServerProxy.servers = {
    'python-http': {
        'command': ['python', '-m', 'http.server', '{port}'],
    }
}" > $CONDA_PREFIX/etc/jupyter/jupyter_notebook_config.py
$ jupyter lab

Evidence that build from this branch doesn't show proxy icon in JL.

$ conda create -n jupyter-server-proxy-new jupyterlab
$ conda activate jupyter-server-proxy-new
$ pip install ./dist/*.whl
$ echo "c.ServerProxy.servers = {
    'python-http': {
        'command': ['python', '-m', 'http.server', '{port}'],
    }
}" > $CONDA_PREFIX/etc/jupyter/jupyter_notebook_config.py
$ jupyter lab

@JanJaguschQC
Copy link
Contributor

JanJaguschQC commented Feb 17, 2021

After pip installing and jupyter labextension installing the latest jupyter-server-release, I went ahead and investigated the built extension. You can see that the extension is located (relative to the venv) in /share/jupyter/lab. In that folder exists a .tgz file that - after having it unzipped - contains all the extension files.

$ jupyter labextension list
JupyterLab v3.0.7
Other labextensions (built into JupyterLab)
   app dir: /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/share/jupyter/lab
        @jupyterlab/server-proxy v2.1.2 enabled OK
$ ls /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/share/jupyter/lab/extensions
jupyterlab-server-proxy-2.1.2.tgz
$ tar -xvf jupyterlab-server-proxy-2.1.2.tgz
x package/style/index.css
x package/lib/index.js
x package/package.json
x package/README.md
x package/lib/index.d.ts

The local build behaves very differently. First of all it's located under a different path (share/jupyter/labextensions). Second it's not .tgz zipped and third it misses files.

$ jupyter labextension list
JupyterLab v3.0.7
/usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/share/jupyter/labextensions
        @jupyterlab/server-proxy v3.0.0-rc.1 enabled OK
$ ls /usr/local/Caskroom/miniforge/base/envs/jupyter-server-proxy-new/share/jupyter/labextensions/jupyter_server_proxy
package.json static

Update: A quick way to check this is by unzipping the .tar.gz build in the ./dist folder.

$ tar -xvf ./dist/jupyter_server_proxy-3.0.0rc1.tar.gz
x jupyter_server_proxy-3.0.0rc1/
x jupyter_server_proxy-3.0.0rc1/LICENSE
x jupyter_server_proxy-3.0.0rc1/PKG-INFO
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/__init__.py
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/api.py
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/config.py
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/etc/
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/handlers.py
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/package.json
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/static/
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/static/remoteEntry.8c07630560a434c2f0c4.js
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/labextension/static/style.js
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/static/
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/static/tree.js
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/utils.py
x jupyter_server_proxy-3.0.0rc1/jupyter_server_proxy/websocket.py
x jupyter_server_proxy-3.0.0rc1/setup.cfg
x jupyter_server_proxy-3.0.0rc1/setup.py

@janjagusch
Copy link
Contributor Author

@janjagusch
Copy link
Contributor Author

as a comparison, this is how the MANIFEST in jupytext looks like after the build:

cat MANIFEST | grep labextension
jupytext/labextension/package.json
jupytext/labextension/schemas/jupyterlab-jupytext/package.json.orig
jupytext/labextension/static/568.7f5409aac48065807db0.js
jupytext/labextension/static/remoteEntry.d91313b3dc0b230a0cdf.js
jupytext/labextension/static/style.js
packages/labextension/LICENSE
packages/labextension/README.md
packages/labextension/package.json
packages/labextension/tsconfig.json
packages/labextension/yarn.lock
packages/labextension/src/index.ts

Interestingly, the jupytext/labextension/ directory contains basically the same files as in our build. However, they also have packages/labextension/ included (which is equivalent with jupyterlab-server-proxy/) here.

@janjagusch
Copy link
Contributor Author

I've updated the MANIFEST.in and now the build contains the necessary files. They are probably at the wrong location though, as the icon is still not showing up in JL.

One more thought that I have is that we're missing the _jupyter_labextension_paths function (jupytext example). I'm not sure what it's for but it seems to do something with the src dir.

Any ideas, @manics, @consideRatio, @jtpio?

@consideRatio
Copy link
Member

Wieeeeee @janjagusch you are amazing!!! What a thorough job you are doing!!!! ❤️ 🎉!!!


One more thought that I have is that we're missing the _jupyter_labextension_paths function (jupytext example). I'm not sure what it's for but it seems to do something with the src dir.

I have no experience about this yet =/

@janjagusch
Copy link
Contributor Author

@martinRenou, I hope you don't mind that I tag you in this PR. 😅

We're trying to take advantage of the Jupyterlab 3.0 release and package the extension together with the Python code. This PR aims to copy what you did previously for jupytext (the most relevant PR is mwouts/jupytext#683 with some follow up bugfix PRs afterwards).

I've been trying to follow your work as closely as possible. This is the current status:

  • You can build and install the package
  • jupyter labextension list tells me that the jupyter-server-proxy extension has been successfully installed
  • The Jupyter Notebook extension works fine
  • The Jupyter Lab extension does not work yet (Package jupyter lab extension #245 (comment))

Currently, our MANIFEST looks like this:

LICENSE
setup.cfg
setup.py
jupyter_server_proxy/__init__.py
jupyter_server_proxy/api.py
jupyter_server_proxy/config.py
jupyter_server_proxy/handlers.py
jupyter_server_proxy/utils.py
jupyter_server_proxy/websocket.py
jupyter_server_proxy/etc/jupyter-server-proxy-jupyterserverextension.json
jupyter_server_proxy/etc/jupyter-server-proxy-nbextension.json
jupyter_server_proxy/etc/jupyter-server-proxy-notebookserverextension.json
jupyter_server_proxy/labextension/package.json
jupyter_server_proxy/labextension/static/568.d13a843b2f37185335bf.js
jupyter_server_proxy/labextension/static/remoteEntry.8c07630560a434c2f0c4.js
jupyter_server_proxy/labextension/static/style.js
jupyter_server_proxy/static/tree.js
jupyterlab-server-proxy/package.json
jupyterlab-server-proxy/tsconfig.json
jupyterlab-server-proxy/yarn.lock
jupyterlab-server-proxy/src/index.ts

So I believe all relevant files are in the distribution (as a comparison to jupytext, see #245 (comment)).

My gut feeling tells me that it's not working yet because Jupyterlab can't find the jupyterlab-server-proxy/src/index.ts file. I believe this might be due to the fact that we haven't defined the _jupyter_labextension_paths function (reference to jupyext), but I'm not exactly sure what this function is for and how to use it.

If you could spare a bit of your time and point me in the right direction, I would really appreciate that! Thanks in advance.

@manics
Copy link
Member

manics commented Feb 18, 2021

I compared the debug logs from this with https://github.com/manics/jupyter-offlinenotebook:

[D 2021-02-18 17:10:33.430 ServerApp] Path jupyter-offlinenotebook/static/remoteEntry.3ff65b0e11753f55260b.js served from /home/user/miniforge3/envs/test/share/jupyter/labextensions/jupyter-offlinenotebook/static/remoteEntry.3ff65b0e11753f55260bjs
[D 2021-02-18 17:10:33.430 ServerApp] 200 GET /lab/extensions/jupyter-offlinenotebook/static/remoteEntry.3ff65b0e11753f55260b.js (172.17.0.1) 169ms

vs

[W 2021-02-18 17:10:33.442 ServerApp] 404 GET /lab/extensions/@jupyterlab/server-proxy/static/remoteEntry.745ee91aef9965280665.js (172.17.0.1) 9.61ms referer=http://172.17.0.2:8888/lab?
$ cd $CONDA_PREFIX/share/jupyter/labextensions
$ ls *
jupyter-offlinenotebook:
package.json  static

jupyter_server_proxy:
package.json  static                                                         

It looks like the browser is trying to load @jupyterlab/server-proxy but the extension is on the filesystem as jupyter_server_proxy

Note I don't think you need to add all files to MANIFEST.in. Since the javascript build takes place before the sdist si created you should only need the resulting javascript, not the source typescript. Edit: though maybe it doesn't matter, might as well leave it if it's working unless someone who know better has a suggestion.

@manics
Copy link
Member

manics commented Feb 18, 2021

For example, manually creating a symlink in $CONDA_PREFIX/share/jupyter/labextensions:

$ mkdir @jupyterlab
$ ln -s ../jupyter_server_proxy @jupyterlab/server-proxy

fixes the 404, and the icon appears

setup.py Outdated Show resolved Hide resolved
janjagusch and others added 2 commits February 18, 2021 20:31
Co-authored-by: Simon Li <orpheus+devel@gmail.com>
@janjagusch
Copy link
Contributor Author

Note I don't think you need to add all files to MANIFEST.in. Since the javascript build takes place before the sdist si created you should only need the resulting javascript, not the source typescript. Edit: though maybe it doesn't matter, might as well leave it if it's working unless someone who know better has a suggestion.

Seems you were right. I reverted the MANIFEST.in to it state in the default branch and can still build and install the extension correctly. I didn't see your edit, so I went ahead and committed those changes in 85ae9e6, haha. If we want we can also change it one more time. @manics

@manics
Copy link
Member

manics commented Feb 18, 2021

@janjagusch Thanks for persevering with this 😄
MANIFEST.in and other aspects of Python packaging remain a mystery to me, and since it's working let's leave it.

@manics manics merged commit 5b82d6f into jupyterhub:master Feb 18, 2021
@welcome
Copy link

welcome bot commented Feb 18, 2021

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@consideRatio
Copy link
Member

@janjagusch wieeee!!! Amazing work on this @janjagusch and @manics fantastic review efforts!!! ❤️ 🎉 Thanks everyone else providing input also, what a great effort!

@JanJaguschQC
Copy link
Contributor

Learned a lot during this PR! Thanks a lot to everyone involved! :)

Also thanks to my manager @xhochy who lets me work on open source during work hours. 🚀

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

Successfully merging this pull request may close these issues.

Package the jupyterlab extension with the Python package
5 participants