diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 8f681ac55..55cd4d625 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -1,7 +1,7 @@ name: Check Release on: push: - branches: ["master"] + branches: ["main"] pull_request: branches: ["*"] @@ -14,9 +14,9 @@ jobs: fail-fast: false steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.9 architecture: "x64" @@ -25,7 +25,7 @@ jobs: run: | echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }} @@ -34,7 +34,7 @@ jobs: ${{ runner.os }}-pip- - name: Cache checked links if: ${{ matrix.group == 'link_check' }} - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.cache/pytest-link-check key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4ff23bd01..a30348548 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,12 +11,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-22.04] - python-version: [ '3.7' ] + python-version: [ '3.10' ] steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} architecture: 'x64' @@ -28,7 +28,7 @@ jobs: run: | echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }} diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index b67bf264e..00420c7bc 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml index dde806f1c..cf28155af 100644 --- a/.github/workflows/js.yml +++ b/.github/workflows/js.yml @@ -18,18 +18,18 @@ jobs: - group: services steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.8 - name: Set up Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: '12.x' - name: Cache node modules - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-node-modules with: @@ -42,7 +42,7 @@ jobs: ${{ runner.os }}- - name: Cache pip on Linux - uses: actions/cache@v1 + uses: actions/cache@v4 if: startsWith(runner.os, 'Linux') with: path: ~/.cache/pip diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 82a1762e9..5bb96adba 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -15,7 +15,7 @@ jobs: python-version: [ '3.7', '3.8', '3.9', '3.10'] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 @@ -23,7 +23,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Set up Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: '12.x' diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7311883f7..95c1c9a9f 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -3,7 +3,7 @@ name: Testing nbclassic on: push: branches: - - master + - main pull_request: jobs: @@ -14,9 +14,14 @@ jobs: matrix: os: [ubuntu-22.04, macos-12, windows-2022] python-version: ["3.7", "3.8", "3.9", "3.10"] + exclude: + - os: ubuntu-22.04 + python-version: "3.7" + - os: macos-12 + python-version: "3.7" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install pip dependencies @@ -48,7 +53,7 @@ jobs: # timeout-minutes: 20 # runs-on: ubuntu-latest # steps: -# - uses: actions/checkout@v2 +# - uses: actions/checkout@v4 # - name: Base Setup # uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 # with: @@ -64,7 +69,7 @@ jobs: timeout-minutes: 20 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install the Python dependencies @@ -83,14 +88,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Build SDist run: | pip install build python -m build --sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: "sdist" path: dist/*.tar.gz @@ -104,7 +109,7 @@ jobs: - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Download sdist - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Install From SDist run: | set -ex diff --git a/CHANGELOG.md b/CHANGELOG.md index 356848089..2d80a46ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,39 @@ +## 1.1.0 + +([Full Changelog](https://github.com/jupyter/nbclassic/compare/v1.0.0...991361437fe0e51da639775f5fbe709cc8212278)) + +### Enhancements made + +- Add issue templates to repository [#258](https://github.com/jupyter/nbclassic/pull/258) ([@RRosio](https://github.com/RRosio)) + +### Bugs fixed + +- Make terminals_available false if key is not in settings dict yet [#261](https://github.com/jupyter/nbclassic/pull/261) ([@RRosio](https://github.com/RRosio)) + +### Maintenance and upkeep improvements + +- fix: trust new notebooks and notebooks with new cells [#275](https://github.com/jupyter/nbclassic/pull/275) ([@maartenbreddels](https://github.com/maartenbreddels)) +- Fix ci end-to-end tests [#274](https://github.com/jupyter/nbclassic/pull/274) ([@maartenbreddels](https://github.com/maartenbreddels)) +- Fix `Linux JS Test` CI job [#269](https://github.com/jupyter/nbclassic/pull/269) ([@krassowski](https://github.com/krassowski)) +- Update dependency requirements to minimum necessary [#259](https://github.com/jupyter/nbclassic/pull/259) ([@RRosio](https://github.com/RRosio)) + +### Documentation improvements + +- Adding pydata_sphinx_theme to environment.yml file for docs build [#262](https://github.com/jupyter/nbclassic/pull/262) ([@RRosio](https://github.com/RRosio)) +- Fix links for check_release links CI job [#260](https://github.com/jupyter/nbclassic/pull/260) ([@RRosio](https://github.com/RRosio)) +- Port to PyData-Sphinx Theme [#256](https://github.com/jupyter/nbclassic/pull/256) ([@RRosio](https://github.com/RRosio)) + +### Contributors to this release + +([GitHub contributors page for this release](https://github.com/jupyter/nbclassic/graphs/contributors?from=2023-05-04&to=2024-05-24&type=c)) + +[@jph00](https://github.com/search?q=repo%3Ajupyter%2Fnbclassic+involves%3Ajph00+updated%3A2023-05-04..2024-05-24&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter%2Fnbclassic+involves%3Akrassowski+updated%3A2023-05-04..2024-05-24&type=Issues) | [@maartenbreddels](https://github.com/search?q=repo%3Ajupyter%2Fnbclassic+involves%3Amaartenbreddels+updated%3A2023-05-04..2024-05-24&type=Issues) | [@RRosio](https://github.com/search?q=repo%3Ajupyter%2Fnbclassic+involves%3ARRosio+updated%3A2023-05-04..2024-05-24&type=Issues) + + + ## 1.0.0 ([Full Changelog](https://github.com/jupyter/nbclassic/compare/v0.5.6...109a62153a74bae9a38f0c4bec460a91429f0c19)) @@ -20,8 +53,6 @@ [@echarles](https://github.com/search?q=repo%3Ajupyter%2Fnbclassic+involves%3Aecharles+updated%3A2023-04-27..2023-05-04&type=Issues) - - ## 0.5.6 ([Full Changelog](https://github.com/jupyter/nbclassic/compare/v0.5.5...ddbbf579a904ef1c040f3221f7dd64d287323636)) diff --git a/docs/environment.yml b/docs/environment.yml index 0b751f5ac..a29b4cb04 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -1,8 +1,9 @@ name: nbclassic_docs channels: - conda-forge + - nodefaults dependencies: -- python=3.8 +- python=3.10 - pydata-sphinx-theme - jinja2 - tornado diff --git a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb index 4be20b7ce..10be06259 100644 --- a/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb +++ b/docs/source/examples/Notebook/Distributing Jupyter Extensions as Python Packages.ipynb @@ -134,7 +134,7 @@ "\n", "> Of course, in addition to the files listed, there are number of other files one needs to build a proper package. Here are some good resources:\n", "- [The Hitchhiker's Guide to Packaging](https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/quickstart.html)\n", - "- [Repository Structure and Python](https://kenreitz.org/essays/2013/01/27/repository-structure-and-python) by Kenneth Reitz\n", + "- [Repository Structure and Python](https://kennethreitz.org/essays/2013/repository_structure_and_python) by Kenneth Reitz\n", "\n", "> How you distribute them, too, is important:\n", "- [Packaging and Distributing Projects](https://python-packaging-user-guide.readthedocs.io/tutorials/distributing-packages/)\n", diff --git a/docs/source/nbclassic.rst b/docs/source/nbclassic.rst index f75e7ba18..58d8dd1df 100644 --- a/docs/source/nbclassic.rst +++ b/docs/source/nbclassic.rst @@ -90,3 +90,19 @@ if available at the `Jupyterlab-contrib website `_ is a +known issue with partial fix `Support nbclassic while updating the static path `_ +pending to be merged into the `Jupyter-contrib/jupyter_nbextensions_configurator `_ repository. + + Once a release with this fix is available, users will be able to activate the extension with the following commands:: + + $ pip install 'jupyter_nbextensions_configurator @ git+https://github.com/datalayer-externals/jupyter-notebook-configurator.git@fix/nbclassic#egg=jupyter_nbextensions_configurator' + $ jupyter nbclassic-extension install --sys-prefix --py jupyter_nbextensions_configurator --overwrite + $ jupyter nbclassic-extension enable --sys-prefix --py jupyter_nbextensions_configurator + $ jupyter nbclassic-serverextension enable --sys-prefix --py jupyter_nbextensions_configurator diff --git a/docs/source/nbclassic_dev_faq.rst b/docs/source/nbclassic_dev_faq.rst index b9e8516f6..5cac94074 100644 --- a/docs/source/nbclassic_dev_faq.rst +++ b/docs/source/nbclassic_dev_faq.rst @@ -72,20 +72,3 @@ NbClassic Developer FAQ .. _`allowed organization list`: https://github.com/MeeseeksBox/MeeseeksDev/blob/master/meeseeksdev/__init__.py#L26 .. _`Jupyter Community`: https://jupyter.org/community - -Known issues ------------- - -Bellow are some known bugs and issues with the NbClassic project. These are items that may be of particular interest to users -migrating from notebook to nbclassic. - -1. `#140 Error using jupyter_nbextensions_configurator with nbclassic `_ is a -known issue with partial fix `Support nbclassic while updating the static path `_ -pending to be merged into the `Jupyter-contrib/jupyter_nbextensions_configurator `_ repository. - - Once a release with this fix is available, users will be able to activate the extension with the following commands:: - - $ pip install 'jupyter_nbextensions_configurator @ git+https://github.com/datalayer-externals/jupyter-notebook-configurator.git@fix/nbclassic#egg=jupyter_nbextensions_configurator' - $ jupyter nbclassic-extension install --sys-prefix --py jupyter_nbextensions_configurator --overwrite - $ jupyter nbclassic-extension enable --sys-prefix --py jupyter_nbextensions_configurator - $ jupyter nbclassic-serverextension enable --sys-prefix --py jupyter_nbextensions_configurator diff --git a/nbclassic/_version.py b/nbclassic/_version.py index f4951f767..9a8750e1e 100644 --- a/nbclassic/_version.py +++ b/nbclassic/_version.py @@ -5,7 +5,7 @@ import re # Version string must appear intact for tbump versioning -__version__ = '1.1.0.dev0' +__version__ = '1.2.0.dev0' # Build up version_info tuple for backwards compatibility pattern = r'(?P\d+).(?P\d+).(?P\d+)(?P.*)' diff --git a/nbclassic/notebookapp.py b/nbclassic/notebookapp.py index bcf947eba..73a4a80c6 100644 --- a/nbclassic/notebookapp.py +++ b/nbclassic/notebookapp.py @@ -280,6 +280,7 @@ def initialize_handlers(self): handlers.extend(load_handlers('nbclassic.tree.handlers')) handlers.extend(load_handlers('nbclassic.notebook.handlers')) handlers.extend(load_handlers('nbclassic.edit.handlers')) + handlers.extend(load_handlers('nbclassic.view.handlers')) self.handlers.extend(handlers) # Wildcard routes @@ -324,7 +325,7 @@ def initialize_handlers(self): router.add_rules(core_rules) router.add_rules(static_handlers) router.add_rules(final_rules) - print(""" + print(r""" _ _ _ _ | | | |_ __ __| |__ _| |_ ___ | |_| | '_ \/ _` / _` | _/ -_) diff --git a/nbclassic/static/base/js/namespace.js b/nbclassic/static/base/js/namespace.js index 9f3deb03d..d7b1ee816 100644 --- a/nbclassic/static/base/js/namespace.js +++ b/nbclassic/static/base/js/namespace.js @@ -73,7 +73,7 @@ define(function(){ // tree jglobal('SessionList','tree/js/sessionlist'); - Jupyter.version = "1.1.0.dev0"; + Jupyter.version = "1.1.0"; Jupyter._target = '_blank'; return Jupyter; diff --git a/nbclassic/static/notebook/js/clipboard.js b/nbclassic/static/notebook/js/clipboard.js index fe4bab90a..725e6d405 100644 --- a/nbclassic/static/notebook/js/clipboard.js +++ b/nbclassic/static/notebook/js/clipboard.js @@ -74,8 +74,8 @@ function paste(event) { } } first_inserted.focus_cell(); + event.preventDefault(); } - event.preventDefault(); } function notebookOnlyEvent(callback) { diff --git a/nbclassic/tests/end_to_end/test_display_isolation.py b/nbclassic/tests/end_to_end/test_display_isolation.py index 59ea9203a..9f1300123 100644 --- a/nbclassic/tests/end_to_end/test_display_isolation.py +++ b/nbclassic/tests/end_to_end/test_display_isolation.py @@ -6,8 +6,10 @@ from .utils import EDITOR_PAGE +import pytest +import sys - +@pytest.mark.skipif(sys.version_info >= (3, 8), reason="Fails in Python 3.8+") def test_display_isolation(notebook_frontend): import_ln = "from IPython.core.display import HTML, SVG, display, display_svg" notebook_frontend.edit_cell(index=0, content=import_ln) diff --git a/nbclassic/view/__init__.py b/nbclassic/view/__init__.py new file mode 100644 index 000000000..6e91c4e16 --- /dev/null +++ b/nbclassic/view/__init__.py @@ -0,0 +1 @@ +"""Tornado handlers for viewing HTML files.""" \ No newline at end of file diff --git a/nbclassic/view/handlers.py b/nbclassic/view/handlers.py new file mode 100644 index 000000000..46c71e51d --- /dev/null +++ b/nbclassic/view/handlers.py @@ -0,0 +1,40 @@ +#encoding: utf-8 +"""Tornado handlers for viewing HTML files.""" + +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. + +from tornado import web, gen + + +from jupyter_server.base.handlers import JupyterHandler, path_regex +from jupyter_server.utils import url_escape, ensure_async, url_path_join + +from nbclassic import nbclassic_path + + +class CustomViewHandler(JupyterHandler): + """Render HTML files within an iframe.""" + + @web.authenticated + @gen.coroutine + def get(self, path): + """Get a view on a given path.""" + + path = path.strip('/') + exists = yield ensure_async(self.contents_manager.file_exists(path)) + if not exists: + raise web.HTTPError(404, u'File does not exist: %s' % path) + + basename = path.rsplit('/', 1)[-1] + file_url = url_path_join(self.base_url, "files", url_escape(path)) + self.write(self.render_template('view.html', + file_url=file_url, + page_title=basename, + ) + ) + + +default_handlers = [ + (r"{}/view{}".format(nbclassic_path(), path_regex), CustomViewHandler), +] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e9fc19a24..b2bd8cc47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ post-version-spec = "dev" ignore-glob = ["docs/source/examples/Notebook/Working With Markdown Cells.ipynb", "docs-translations/**/README.md", "docs/source/contributing.rst", "docs/source/examples/Notebook/JavaScript Notebook Extensions.ipynb", "CHANGELOG.md", "nbclassic/static/components/**/*.*"] [tool.tbump.version] -current = "1.1.0.dev0" +current = "1.2.0.dev0" regex = ''' (?P\d+)\.(?P\d+)\.(?P\d+) ((?Pa|b|rc|.dev)(?P\d+))? diff --git a/readthedocs.yml b/readthedocs.yml index b9eadb806..59c552f4f 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -1,4 +1,12 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "miniconda3-4.7" + conda: - file: docs/environment.yml -python: - version: 3 + environment: docs/environment.yml + +sphinx: + configuration: docs/source/conf.py diff --git a/setupbase.py b/setupbase.py index 80f28b6eb..4e7a4feec 100644 --- a/setupbase.py +++ b/setupbase.py @@ -12,7 +12,7 @@ import os import re -import pipes +import shlex import shutil import sys @@ -27,7 +27,7 @@ from subprocess import list2cmdline else: def list2cmdline(cmd_list): - return ' '.join(map(pipes.quote, cmd_list)) + return ' '.join(map(shlex.quote, cmd_list)) #------------------------------------------------------------------------------- # Useful globals and utility functions @@ -486,7 +486,7 @@ def run(self): try: run(['lessc', '--source-map', - '--include-path=%s' % pipes.quote(static), + '--include-path=%s' % shlex.quote(static), src, dst, ], cwd=repo_root, env=env)