Giter Site home page Giter Site logo

notebook_shim's Introduction

Jupyter

Read this in other languages: English, Español, Português, Français

Jupyter metapackage for installation and documents

Documentation structure

This documentation uses the Sphinx documentation engine.

The documentation is located in the docs/source folder. When you build the documentation, it will be placed in the docs/build folder. It is written in a combination of reStructuredText and MyST Markdown.

Build the documentation locally

There are a few ways to build the documentation; see below for instructions:

Build the documentation automatically with nox

The easiest way to build the documentation locally is by using the nox command line tool. This tool makes it easy to automate commands in a repository, and we have included a docs command to quickly install the dependencies and build the documentation.

To build and preview the site locally, follow these steps:

  1. Clone this repository.

    $ git clone https://github.com/jupyter/jupyter
    $ cd jupyter
  2. Install nox

    $ pip install nox
  3. Run the docs command

    $ nox -s docs

This will install the needed dependencies in a virtual environment using pip. It will then place the documentation in the docs/build/html folder. You may explore these HTML files in order to preview the site.

Create a live server to automatically preview changes

There is another nox command that will do the above, and also create a live server that watches your source files for changes, and auto-builds the website any time a change is made.

To start this live server, use the following nox command:

$ nox -s docs-live

When the build is finished, go to the URL that is displayed. It should show a live preview of your documentation.

To stop serving the website, press Ctrl-C in your terminal

Build the documentation manually

To build the documentation manually, follow these steps:

First, install the miniconda Python distribution.

Next, navigate to the /docs directory and create a conda environment:

conda env create -f environment.yml

Activate the environment:

source activate jupyter_docs

Build the docs using Sphinx with the following commands:

make clean
make html

The docs will be built in build/html. They can be viewed by opening build/html/index.html or starting an HTTP server and navigating to 0.0.0.0:8000 in your web browser.

python3 -m http.server

Releasing the jupyter metapackage

Anyone with push access to this repo can make a release of the Jupyter metapackage (this happens very rarely). We use tbump to publish releases.

tbump updates version numbers and publishes the git tag of the version. Our GitHub Actions then build the releases and publish them to PyPI.

The steps involved:

  1. Install tbump: pip install tbump
  2. Tag and publish the release tbump $NEW_VERSION.

That's it!

notebook_shim's People

Contributors

blink1073 avatar dleen avatar echarles avatar github-actions[bot] avatar jtpio avatar jupyter-release-bot avatar zsailer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notebook_shim's Issues

0.1.0: pytest is failing

Looks like now after few upgrades in build env insteda warnings reported in #7 I have failling pytest .

Here is list of modules installed in build env:

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
anyio                         3.6.1
apeye                         1.2.0
appdirs                       1.4.4
argon2-cffi                   21.1.0
attrs                         22.1.0
autodocsumm                   0.2.9
Babel                         2.10.2
beautifulsoup4                4.10.0
bleach                        5.0.0
build                         0.8.0
CacheControl                  0.12.11
cffi                          1.15.1
charset-normalizer            2.1.0
click                         8.1.2
codespell                     2.1.0
coincidence                   0.6.2
consolekit                    1.4.1
cssutils                      2.5.1
defusedxml                    0.7.1
deprecation                   2.1.0
deprecation-alias             0.3.1
dict2css                      0.3.0
dist-meta                     0.5.0
distro                        1.7.0
docutils                      0.18.1
dom_toml                      0.6.0
domdf-python-tools            3.2.2.post1
entrypoints                   0.4
extras                        1.0.0
extras-require                0.4.1.post1
fastjsonschema                2.16.1
fixtures                      4.0.0
gpg                           1.17.1-unknown
handy-archives                0.1.2
html5lib                      1.1
idna                          3.3
imagesize                     1.4.1
importlib-metadata            4.12.0
importlib-resources           5.9.0
iniconfig                     1.1.1
Jinja2                        3.1.1
jsonschema                    4.9.1
jupyter_client                7.3.4
jupyter_core                  4.11.1
jupyter_packaging             0.12.2
jupyter-server                1.18.1
jupyterlab-pygments           0.1.2
libcomps                      0.1.18
lockfile                      0.12.2
MarkupSafe                    2.1.1
mistletoe                     0.8.2
mistune                       2.0.3
msgpack                       1.0.4
natsort                       8.0.2
nbclient                      0.6.6
nbconvert                     6.5.0
nbformat                      5.4.0
nest-asyncio                  1.5.5
packaging                     21.3
pandocfilters                 1.5.0
pbr                           5.9.0
pep517                        0.12.0
pip                           22.2.1
pkgutil_resolve_name          1.3.10
platformdirs                  2.5.2
pluggy                        1.0.0
ply                           3.11
prometheus-client             0.14.1
ptyprocess                    0.7.0
py                            1.11.0
pycparser                     2.21
Pygments                      2.12.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.18.1
pytest                        7.1.2
pytest-datadir                1.3.1
pytest-regressions            2.3.1
pytest-timeout                2.1.0
pytest-tornasync              0.6.0.post2
python-dateutil               2.8.2
pytz                          2022.1
PyYAML                        6.0
pyzmq                         23.2.0
requests                      2.28.1
rpm                           4.17.0
ruamel.yaml                   0.17.21
ruamel.yaml.clib              0.2.6
Send2Trash                    1.8.0
setuptools                    63.4.2
shippinglabel                 1.0.1
six                           1.16.0
sniffio                       1.2.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.1.1
sphinx-autodoc-typehints      1.19.2
sphinx-jinja2-compat          0.1.2
sphinx-prompt                 1.4.0
sphinx-pyproject              0.1.0
sphinx-tabs                   3.4.1
sphinx-toolbox                3.1.2
sphinxcontrib-applehelp       1.0.2.dev20220730
sphinxcontrib-devhelp         1.0.2.dev20220730
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220730
sphinxcontrib-qthelp          1.0.3.dev20220730
sphinxcontrib-serializinghtml 1.1.5
tabulate                      0.8.9
terminado                     0.15.0
testtools                     2.5.0
tinycss2                      1.1.1
toml                          0.10.2
tomli                         2.0.1
tomlkit                       0.11.2
tornado                       6.2
traitlets                     5.3.0
trove-classifiers             2022.8.8
typing_extensions             4.2.0
urllib3                       1.26.11
webencodings                  0.5.1
websocket-client              1.3.2
wheel                         0.37.1
zipp                          3.8.1

v0.2.0 does not load all notebook extensions

Hi,
It looks like updating notebook-shim from v0.1.0 to v0.2.0 breaks some notebook extensions, or does not load them. In particular vim_binding does not work anymore when using jupyter nbclassic.
Downgrading to v0.1.0 fixes the issue. Unfortunately no log or something to find out where it fails.
Cheers.

0.2.2: pytest warnings

Looks like pytest shows some warnings

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.2.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.2.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.15, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/notebook_shim-0.2.2, configfile: pyproject.toml, testpaths: notebook_shim/tests
plugins: anyio-3.6.1, tornasync-0.6.0.post2
collected 10 items

notebook_shim/tests/test_extension.py ..........                                                                                                                     [100%]

============================================================================= warnings summary =============================================================================
notebook_shim/tests/test_extension.py: 10 warnings
  /usr/lib64/python3.8/site-packages/tornado/ioloop.py:350: DeprecationWarning: make_current is deprecated; start the event loop first
    self.make_current()

notebook_shim/tests/test_extension.py: 10 warnings
  /usr/lib/python3.8/site-packages/pytest_tornasync/plugin.py:65: DeprecationWarning: make_current is deprecated; start the event loop first
    loop.make_current()

notebook_shim/tests/test_extension.py: 10 warnings
  /usr/lib/python3.8/site-packages/pytest_tornasync/plugin.py:67: DeprecationWarning: clear_current is deprecated
    loop.clear_current()

notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv0-jinja_environment_options-trait_value0]
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:3278: FutureWarning: --jinja_environment_options={} for dict-traits is deprecated in traitlets 5.0. You can pass --jinja_environment_options <key=value> ... multiple times to add items to a dict.
    warn(

notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv1-jinja_template_vars-trait_value1]
  /usr/lib/python3.8/site-packages/traitlets/traitlets.py:3278: FutureWarning: --jinja_template_vars={} for dict-traits is deprecated in traitlets 5.0. You can pass --jinja_template_vars <key=value> ... multiple times to add items to a dict.
    warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
===================================================================== 10 passed, 32 warnings in 0.45s ======================================================================

Can't capture logs

Hi,

I am trying to package this inside a rpmbuild environment, and running the unittests is mandatory. Currently the test suite fails because the fixture is unable to capture the log, although the expected output is in stderr:

 [    9s] + pytest-3.9 --ignore=_build.python39 --ignore=_build.python310 --ignore=_build.python38 -v notebook_shim
[    9s] ============================= test session starts ==============================
[    9s] platform linux -- Python 3.9.13, pytest-7.1.1, pluggy-1.0.0 -- /usr/bin/python3.9
[    9s] cachedir: .pytest_cache
[    9s] rootdir: /home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0, configfile: pyproject.toml
[    9s] plugins: tornasync-0.6.0.post2, console-scripts-1.3.1, anyio-3.5.0
[    9s] collecting ... collected 10 items
[    9s] 
[    9s] notebook_shim/tests/test_extension.py::test_EXTAPP_AND_NBAPP_SHIM_MSG[jp_argv0-enable_mathjax-False] FAILED [ 10%]
[    9s] notebook_shim/tests/test_extension.py::test_EXTAPP_AND_SVAPP_SHIM_MSG[jp_argv0-allow_origin-] FAILED [ 20%]
[    9s] notebook_shim/tests/test_extension.py::test_EXTAPP_AND_SVAPP_SHIM_MSG[jp_argv1-allow_origin_pat-] FAILED [ 30%]
[    9s] notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv0-jinja_environment_options-trait_value0] FAILED [ 40%]
[   10s] notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv1-jinja_template_vars-trait_value1] FAILED [ 50%]
[   10s] notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv2-extra_template_paths-trait_value2] FAILED [ 60%]
[   10s] notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv3-quit_button-True] FAILED [ 70%]
[   10s] notebook_shim/tests/test_extension.py::test_EXTAPP_TO_SVAPP_SHIM_MSG[jp_argv0-allow_credentials-False] FAILED [ 80%]
[   10s] notebook_shim/tests/test_extension.py::test_EXTAPP_TO_NBAPP_SHIM_MSG[jp_argv0-mathjax_config-TEST] FAILED [ 90%]
[   10s] notebook_shim/tests/test_extension.py::test_EXTAPP_TO_NBAPP_SHIM_MSG[jp_argv1-mathjax_url-TEST] FAILED [100%]
[   10s] 
[   10s] =================================== FAILURES ===================================
[   10s] ________ test_EXTAPP_AND_NBAPP_SHIM_MSG[jp_argv0-enable_mathjax-False] _________
[   10s] 
[   10s] extensionapp = <notebook_shim.tests.mockextension.MockExtensionApp object at 0x7f93a3d11550>
[   10s] extapp_log = <_io.StringIO object at 0x7f93a3db3f70>
[   10s] jp_argv = ['--MockExtensionApp.enable_mathjax=False']
[   10s] trait_name = 'enable_mathjax', trait_value = False
[   10s] 
[   10s]     @pytest.mark.parametrize(
[   10s]         'jp_argv,trait_name,trait_value',
[   10s]         list_test_params([
[   10s]             ('enable_mathjax', False)
[   10s]         ])
[   10s]     )
[   10s]     def test_EXTAPP_AND_NBAPP_SHIM_MSG(
[   10s]         extensionapp,
[   10s]         extapp_log,
[   10s]         jp_argv,
[   10s]         trait_name,
[   10s]         trait_value
[   10s]     ):
[   10s]         log = extapp_log.getvalue()
[   10s]         # Verify a shim warning appeared.
[   10s]         log_msg = shim.EXTAPP_AND_NBAPP_SHIM_MSG(trait_name, 'MockExtensionApp')
[   10s] >       assert log_msg in log
[   10s] E       assert "'enable_mathjax' is found in both MockExtensionApp and NotebookApp. This is a recent change. This config will only be set in MockExtensionApp. Please check if you should also config these traits in NotebookApp for your purpose." in ''
[   10s] 
[   10s] notebook_shim/tests/test_extension.py:89: AssertionError
[   10s] ---------------------------- Captured stderr setup -----------------------------
[   10s] [D 2022-06-05 18:18:08.822 ServerApp] Config changed: {'ServerApp': {'jpserver_extensions': {'notebook_shim': True, 'notebook_shim.tests.mockextension': True}}, 'NotebookNotary': {'db_file': ':memory:'}}
[   10s] [W 2022-06-05 18:18:08.839 MockExtensionApp] 'enable_mathjax' is found in both MockExtensionApp and NotebookApp. This is a recent change. This config will only be set in MockExtensionApp. Please check if you should also config these traits in NotebookApp for your purpose.
[   10s] ------------------------------ Captured log setup ------------------------------
[   10s] DEBUG    ServerApp:application.py:174 Searching ['/home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0', '/tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/config', '/home/abuild/.local/etc/jupyter', '/tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/env/etc/jupyter', '/tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/etc/jupyter'] for config files
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/env/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_config in /home/abuild/.local/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/config
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_config in /home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_server_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_server_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/env/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_server_config in /home/abuild/.local/etc/jupyter
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_server_config in /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/config
[   10s] DEBUG    ServerApp:application.py:837 Looking for jupyter_server_config in /home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0
[   10s] DEBUG    ServerApp:config_manager.py:97 Paths used for configuration of jupyter_server_config: 
[   10s]        /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/etc/jupyter/jupyter_server_config.json
[   10s] DEBUG    ServerApp:config_manager.py:97 Paths used for configuration of jupyter_server_config: 
[   10s]        /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/env/etc/jupyter/jupyter_server_config.json
[   10s] DEBUG    ServerApp:config_manager.py:97 Paths used for configuration of jupyter_server_config: 
[   10s]        /home/abuild/.local/etc/jupyter/jupyter_server_config.json
[   10s] DEBUG    ServerApp:config_manager.py:97 Paths used for configuration of jupyter_server_config: 
[   10s]        /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/config/jupyter_server_config.json
[   10s] DEBUG    ServerApp:config_manager.py:97 Paths used for configuration of jupyter_server_config: 
[   10s]        /home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0/jupyter_server_config.d/notebook_shim.json
[   10s]        /home/abuild/rpmbuild/BUILD/notebook_shim-0.1.0/jupyter_server_config.json
[   10s] INFO     ServerApp:serverapp.py:2674 Serving notebooks from local directory: /tmp/pytest-of-abuild/pytest-19/test_EXTAPP_AND_NBAPP_SHIM_MSG0/root_dir
[   10s] INFO     ServerApp:serverapp.py:2674 Jupyter Server 1.15.6 is running at:
[   10s] INFO     ServerApp:serverapp.py:2674 http://localhost:34279/a%40b/?token=...
[   10s] INFO     ServerApp:serverapp.py:2674  or http://127.0.0.1:34279/a%40b/?token=...
[   10s] INFO     ServerApp:serverapp.py:2675 Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

I have tried pytest -s, pytest -p no:logging, and checked that the extapp_logcapture is loaded during setup. I have run out of ideas.

Editor does not open `.py` files

Clicking on a python source file in the file browser opens a download instead of opening the file in an editor.

Versions:

  • jupyterlab: 3.5.0
  • jupyter_server: 1.23.3
  • notebook-shim: 0.2.2

0.1.0: pytest warnings

Description

Looks like latest pytest shows few warnings.

Reproduce

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Expected behavior

pytest should endup cleanly.

Context

  • Operating System and version: Linux x86/64
  • Browser and version: N/A
  • JupyterLab version: N/A
Troubleshoot Output
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.1.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra notebook_shim/tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/notebook_shim-0.1.0, configfile: pyproject.toml, testpaths: notebook_shim/tests
plugins: anyio-3.3.4, tornasync-0.6.0.post2
collected 10 items

notebook_shim/tests/test_extension.py .......... [100%]

============================================================================= warnings summary =============================================================================
notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv0-jinja_environment_options-trait_value0]
/usr/lib/python3.8/site-packages/traitlets/traitlets.py:3044: FutureWarning: --jinja_environment_options={} for dict-traits is deprecated in traitlets 5.0. You can pass --jinja_environment_options <key=value> ... multiple times to add items to a dict.
warn(

notebook_shim/tests/test_extension.py::test_NOT_EXTAPP_NBAPP_AND_SVAPP_SHIM_MSG[jp_argv1-jinja_template_vars-trait_value1]
/usr/lib/python3.8/site-packages/traitlets/traitlets.py:3044: FutureWarning: --jinja_template_vars={} for dict-traits is deprecated in traitlets 5.0. You can pass --jinja_template_vars <key=value> ... multiple times to add items to a dict.
warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================================================== 10 passed, 2 warnings in 0.78s ======================================================================
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-66f4d800-0c51-47fc-acdc-28c249ce9b1a'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-b52bddbf-fb1d-4232-b1ce-7c3a3f1add6a'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-7ccdf643-133c-453a-bad8-2b7a09aceb73'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-204ffb07-b158-4549-8f80-6b523e07f75e'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-bcd5fd24-e000-46a2-beda-b575cb23716d'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-9c66735f-792c-45c3-a022-306471e1921f'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-7e26ab41-a900-410c-87fe-d9791ae7c4e1'
warnings.warn(

BTW if pytestt executest without notebook_shim/tests param it fails

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.1.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-notebook-shim-0.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/notebook_shim-0.1.0, configfile: pyproject.toml, testpaths: notebook_shim/tests
plugins: anyio-3.3.4, tornasync-0.6.0.post2
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:
It affects the entire test suite instead of just below the conftest as expected.
  /home/tkloczko/rpmbuild/BUILD/notebook_shim-0.1.0/notebook_shim/conftest.py
Please move it to a top level conftest file at the rootdir:
  /home/tkloczko/rpmbuild/BUILD/notebook_shim-0.1.0
For more information, visit:
  https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files
========================================================================= short test summary info ==========================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.12s =============================================================================

So it would be good to add entries in pytest.ini.

test should depend on pytest-jupyter or jupyter-server[test]

pytest_plugin in jupyter-server needs pytest-jupyter but pytest-jupyter is not a runtime dependency of jupyter-server so notebook-shim should either switch from tornasync to pytest-jupyter and keep jupyter-server as a runtime dependency or have jupyter-server[test] in the test dependencies (which would also bring unnecessary pre-commit which is not good).

Error using notebook_shim with jupyter_nbextensions_configurator

I'm trying to use nbclassic (0.4.2.) with the jupyter_nbextensions_configurator using the notebook_shim and getting the following error:

[I 2022-07-07 13:15:54.243 ServerApp] notebook_shim | extension was successfully loaded.
[D 2022-07-07 13:15:54.243 ServerApp] [jupyter_nbextensions_configurator] Loading 0.4.1
[D 2022-07-07 13:15:54.243 ServerApp] [jupyter_nbextensions_configurator]   Editing templates path to add /usr/local/lib/python3.9/site-packages/jupyter_nbextensions_configurator/templates
[D 2022-07-07 13:15:54.243 ServerApp] [jupyter_nbextensions_configurator]   Editing nbextensions path to add /usr/local/lib/python3.9/site-packages/jupyter_nbextensions_configurator/static
[D 2022-07-07 13:15:54.243 ServerApp] Traceback (most recent call last):
      File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 351, in load_extension
        extension.load_all_points(self.serverapp)
      File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 231, in load_all_points
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 231, in <listcomp>
        return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
      File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 224, in load_point
        return point.load(serverapp)
      File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 150, in load
        return loader(serverapp)
      File "/usr/local/lib/python3.9/site-packages/jupyter_nbextensions_configurator/__init__.py", line 247, in load_jupyter_server_extension
        if static_files_path not in webapp.settings['nbextensions_path']:
    KeyError: 'nbextensions_path'
    
[W 2022-07-07 13:15:54.243 ServerApp] jupyter_nbextensions_configurator | extension failed loading with message: 'nbextensions_path'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.