diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index b1c953d5a..000000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "notebook/static/components" -} \ No newline at end of file diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 14d6186a4..870668b4e 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -61,6 +61,7 @@ jobs: uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 with: token: ${{ secrets.GITHUB_TOKEN }} + version_spec: 100.100.100 - name: Check Links if: ${{ matrix.group == 'link_check' }} uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 diff --git a/.github/workflows/enforce-label.yml b/.github/workflows/enforce-label.yml index 354a0468d..d09f46897 100644 --- a/.github/workflows/enforce-label.yml +++ b/.github/workflows/enforce-label.yml @@ -1,3 +1,6 @@ +# Pull requests to this repo should have a triage label, +# this workflow ensures that this is the case. + name: Enforce PR label on: diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml deleted file mode 100644 index 6f1bf4c38..000000000 --- a/.github/workflows/js.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Linux JS Tests - -on: - push: - branches: '*' - pull_request: - branches: '*' - -jobs: - build: - runs-on: ${{ matrix.os }}-latest - strategy: - fail-fast: false - matrix: - os: [ubuntu, macos] - group: [notebook, base, services] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Cache pip on Linux - uses: actions/cache@v1 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('**/requirements.txt', 'setup.py') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python }} - - - name: Temporary workaround for sanitizer loading in JS Tests - run: | - cp tools/security_deprecated.js notebook/static/base/js/security.js - - - name: Install dependencies - run: | - pip install --upgrade pip - pip install --upgrade setuptools wheel - npm install - npm install -g casperjs@1.1.3 phantomjs-prebuilt@2.1.7 - pip install .[test] - - - name: Run Tests - run: | - python -m notebook.jstest ${{ matrix.group }} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 282ea1fd8..77fc5dfe6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -22,7 +22,7 @@ jobs: architecture: 'x64' - name: Upgrade packaging dependencies run: | - pip install --upgrade pip setuptools wheel --user + python -m pip install --upgrade pip setuptools wheel --user - name: Get pip cache dir id: pip-cache run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e69de29bb..0952f479d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -0,0 +1,2 @@ +repos: [] + diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 6f947cb58..b2b79e72f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -71,7 +71,7 @@ If you are working in development mode, you will see that your version of Jupyte Troubleshooting the Installation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If you do not see that your Jupyter Notebook is not running on dev mode, it's possible that you are +If you do not see that your Jupyter Notebook is running on dev mode, it's possible that you are running other instances of Jupyter Notebook. You can try the following steps: 1. Uninstall all instances of the notebook package. These include any installations you made using diff --git a/MANIFEST.in b/MANIFEST.in index c28b82010..64b17e3a8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,13 +3,10 @@ include CONTRIBUTING.rst include README.md include CHANGELOG.md include package.json -include bower.json -include .bowerrc include pyproject.toml include setup.py include setupbase.py include Dockerfile -include *.js graft tools graft notebook/tests diff --git a/bower.json b/bower.json deleted file mode 100644 index 5f72f6ff0..000000000 --- a/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "jupyter-notebook-deps", - "version": "0.0.1", - "dependencies": { - "backbone": "components/backbone#~1.2", - "bootstrap": "bootstrap#~3.4", - "bootstrap-tour": "0.9.0", - "codemirror": "components/codemirror#5.56.0+components1", - "create-react-class": "https://cdn.jsdelivr.net/npm/create-react-class@15.6.3/create-react-class.min.js", - "es6-promise": "~1.0", - "font-awesome": "components/font-awesome#~4.7.0", - "google-caja": "5669", - "jed": "~1.1.1", - "jquery": "components/jquery#~3.5.0", - "jquery-typeahead": "~2.10.6", - "jquery-ui": "components/jqueryui#~1.12", - "marked": "~0.7", - "MathJax": "^2.7.4", - "moment": "~2.19.3", - "react": "~16.0.0", - "requirejs": "~2.2", - "requirejs-text": "~2.0.15", - "requirejs-plugins": "~1.0.3", - "text-encoding": "~0.1", - "underscore": "components/underscore#~1.8.3", - "xterm.js": "https://unpkg.com/xterm@~3.1.0/dist/xterm.js", - "xterm.js-css": "https://unpkg.com/xterm@~3.1.0/dist/xterm.css", - "xterm.js-fit": "https://unpkg.com/xterm@~3.1.0/dist/addons/fit/fit.js" - } -} diff --git a/docs/environment.yml b/docs/environment.yml index 55cea9b26..8df81e98a 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -13,6 +13,7 @@ dependencies: - sphinx - terminado - myst-parser +- nbclassic>=0.4.0 - pip: - nbsphinx - Send2Trash 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 c0dd7daae..13a2e08e6 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", + "- [Structure of the Repository](https://docs.python-guide.org/writing/structure/) by Kenneth Reitz and Real Python\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/notebook/__init__.py b/notebook/__init__.py index c72096f26..6c71e6e7b 100644 --- a/notebook/__init__.py +++ b/notebook/__init__.py @@ -1,8 +1,6 @@ """The Jupyter HTML Notebook""" import os -# Packagers: modify this line if you store the notebook static files elsewhere -DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "static") # Packagers: modify the next line if you store the notebook template files # elsewhere diff --git a/notebook/_version.py b/notebook/_version.py index e1eeaf771..95e5289c0 100644 --- a/notebook/_version.py +++ b/notebook/_version.py @@ -14,7 +14,3 @@ parts = [int(match[part]) for part in ['major', 'minor', 'patch']] if match['rest']: parts.append(match['rest']) version_info = tuple(parts) - -# Downstream maintainer, when running `python.setup.py jsversion`, -# the version string is propagated to the JavaScript files, do not forget to -# patch the JavaScript files in `.postN` release done by distributions. diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index a274f4bb3..bd82f497c 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -66,11 +66,12 @@ if not sys.platform.startswith('win'): from notebook import ( DEFAULT_NOTEBOOK_PORT, - DEFAULT_STATIC_FILES_PATH, DEFAULT_TEMPLATE_PATH_LIST, __version__, ) - +import nbclassic +# Packagers: modify this line if you store the notebook static files elsewhere +DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(nbclassic.__file__), "static") from .base.handlers import Template404, RedirectWithParams from .log import log_request diff --git a/notebook/static/acc_overwrite.less b/notebook/static/acc_overwrite.less deleted file mode 100644 index 4209ea633..000000000 --- a/notebook/static/acc_overwrite.less +++ /dev/null @@ -1,61 +0,0 @@ -//This is file created for overwriting some of bootstrap element color in order to satisfiy the color contrast greater than 4.5:1. - -.btn-danger{ - color: #ffffff; - background-color: #df0404; - border-color: #df0404; -} - -.btn-warning{ - color: #ffffff; - background-color:#b46102; - border-color: #b46102; -} - -@link-color: #296eaa; - -.close { - float: right; - font-size: (@font-size-base * 1.5); - font-weight: @close-font-weight; - line-height: 1; - color: @close-color; - text-shadow: @close-text-shadow; - .opacity(.6); - - &:hover, - &:focus { - color: @close-color; - text-decoration: none; - cursor: pointer; - .opacity(1.0); -} button& { - padding: 0; - cursor: pointer; - background: transparent; - border: 0; - -webkit-appearance: none; - appearance: none; - } -} - -.navbar-nav { - > li > a { - color: @navbar-default-link-color; - // To make keyboard focus clearly visible on the Controls(File,Edit,View,Insert,Cell...etc)present on the menubar. - //&:hover, //To use browser's hover default value - &:focus { - /* -webkit-focus-ring-color = '#5B9DD9' */ - outline: -webkit-focus-ring-color auto 5px; - // color: @navbar-default-link-hover-color; - // background-color: @navbar-default-link-hover-bg; - } - } -} - -.menu_focus_highlight{ - a:focus { - outline: -webkit-focus-ring-color auto 5px; -} -} - diff --git a/notebook/static/auth/css/override.css b/notebook/static/auth/css/override.css deleted file mode 100644 index 0cb116ec2..000000000 --- a/notebook/static/auth/css/override.css +++ /dev/null @@ -1,8 +0,0 @@ -/*This file contains any manual css for this page that needs to override the global styles. -This is only required when different pages style the same element differently. This is just -a hack to deal with our current css styles and no new styling should be added in this file.*/ - -#ipython-main-app { - padding-top: 50px; - text-align: center; -} diff --git a/notebook/static/auth/js/loginmain.js b/notebook/static/auth/js/loginmain.js deleted file mode 100644 index 0c6b661f7..000000000 --- a/notebook/static/auth/js/loginmain.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. - -define(['jquery', 'base/js/namespace', 'base/js/page'], function($, IPython, page) { - function login_main() { - var page_instance = new page.Page('div#header', 'div#site'); - page_instance.show(); - $('input#password_input').focus(); - IPython.page = page_instance; - } - return login_main; -}); diff --git a/notebook/static/auth/js/loginwidget.js b/notebook/static/auth/js/loginwidget.js deleted file mode 100644 index 8b68d3e84..000000000 --- a/notebook/static/auth/js/loginwidget.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. - -define([ - 'jquery', - 'base/js/utils', -], function($, utils){ - "use strict"; - - var LoginWidget = function (selector, options) { - options = options || {}; - this.base_url = options.base_url || utils.get_body_data("baseUrl"); - this.selector = selector; - if (this.selector !== undefined) { - this.element = $(selector); - this.bind_events(); - } - }; - - - LoginWidget.prototype.bind_events = function () { - var that = this; - this.element.find("button#logout").click(function () { - window.location = utils.url_path_join( - that.base_url, - "logout" - ); - }); - this.element.find("button#login").click(function () { - window.location = utils.url_path_join( - that.base_url, - "login" - ); - }); - }; - - return {'LoginWidget': LoginWidget}; -}); diff --git a/notebook/static/auth/js/logoutmain.js b/notebook/static/auth/js/logoutmain.js deleted file mode 100644 index 41e775053..000000000 --- a/notebook/static/auth/js/logoutmain.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. - -define(['base/js/namespace', 'base/js/page'], function(IPython, page) { - function logout_main() { - var page_instance = new page.Page('div#header', 'div#site'); - page_instance.show(); - - IPython.page = page_instance; - } - return logout_main; -}); diff --git a/notebook/static/auth/js/main.js b/notebook/static/auth/js/main.js deleted file mode 100644 index 68d7871c5..000000000 --- a/notebook/static/auth/js/main.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. - -define(['./loginmain', './logoutmain', 'bidi/bidi'], function (login_main, logout_main, bidi) { - if(bidi.isMirroringEnabled()){ - $("body").attr("dir","rtl"); - } - return { - login_main: login_main, - logout_main: logout_main - }; -}); diff --git a/notebook/static/auth/less/login.less b/notebook/static/auth/less/login.less deleted file mode 100644 index 8a4ce3ffc..000000000 --- a/notebook/static/auth/less/login.less +++ /dev/null @@ -1,23 +0,0 @@ -// Custom styles for login.html -.center-nav { - display: inline-block; - // pull the lower margin back - margin-bottom: -4px; -} - -[dir="rtl"] .center-nav { - form.pull-left { - .pull-right(); - } - .navbar-text { - float: right; - } -} - -[dir="rtl"] .navbar-inner { - text-align: right; -} - -[dir="rtl"] div.text-left { - .text-right(); -} diff --git a/notebook/static/auth/less/logout.less b/notebook/static/auth/less/logout.less deleted file mode 100644 index 63cd701c9..000000000 --- a/notebook/static/auth/less/logout.less +++ /dev/null @@ -1,2 +0,0 @@ -// Custom styles for logout.html - diff --git a/notebook/static/auth/less/style.less b/notebook/static/auth/less/style.less deleted file mode 100644 index 4d1919cc0..000000000 --- a/notebook/static/auth/less/style.less +++ /dev/null @@ -1,7 +0,0 @@ -/*! -* -* IPython auth -* -*/ -@import "login.less"; -@import "logout.less"; \ No newline at end of file diff --git a/notebook/static/base/images/favicon-busy-1.ico b/notebook/static/base/images/favicon-busy-1.ico deleted file mode 100644 index 5b46a8226..000000000 Binary files a/notebook/static/base/images/favicon-busy-1.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon-busy-2.ico b/notebook/static/base/images/favicon-busy-2.ico deleted file mode 100644 index 4a8b841c2..000000000 Binary files a/notebook/static/base/images/favicon-busy-2.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon-busy-3.ico b/notebook/static/base/images/favicon-busy-3.ico deleted file mode 100644 index b5edce573..000000000 Binary files a/notebook/static/base/images/favicon-busy-3.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon-file.ico b/notebook/static/base/images/favicon-file.ico deleted file mode 100644 index 8167018cd..000000000 Binary files a/notebook/static/base/images/favicon-file.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon-notebook.ico b/notebook/static/base/images/favicon-notebook.ico deleted file mode 100644 index 4537e2d98..000000000 Binary files a/notebook/static/base/images/favicon-notebook.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon-terminal.ico b/notebook/static/base/images/favicon-terminal.ico deleted file mode 100644 index ace499a33..000000000 Binary files a/notebook/static/base/images/favicon-terminal.ico and /dev/null differ diff --git a/notebook/static/base/images/favicon.ico b/notebook/static/base/images/favicon.ico deleted file mode 100644 index 2d1bcff7c..000000000 Binary files a/notebook/static/base/images/favicon.ico and /dev/null differ diff --git a/notebook/static/base/images/logo.png b/notebook/static/base/images/logo.png deleted file mode 100644 index 3f3f57ff3..000000000 Binary files a/notebook/static/base/images/logo.png and /dev/null differ diff --git a/notebook/static/base/js/dialog.js b/notebook/static/base/js/dialog.js deleted file mode 100644 index 77d81185f..000000000 --- a/notebook/static/base/js/dialog.js +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (c) Jupyter Development Team. -// Distributed under the terms of the Modified BSD License. - -define(['jquery', - 'codemirror/lib/codemirror', - 'bootstrap', - 'base/js/i18n'], - function($, CodeMirror, bs, i18n) { - "use strict"; - - /** - * A wrapper around bootstrap modal for easier use - * Pass it an option dictionary with the following properties: - * - * - body : or , main content of the dialog - * if pass a it will be wrapped in a p tag and - * html element escaped, unless you specify sanitize=false - * option. - * - title : Dialog title, default to empty string. - * - buttons : dict of btn_options who keys are button label. - * see btn_options below for description - * - open : callback to trigger on dialog open. - * - destroy: - * - notebook : notebook instance - * - keyboard_manager: keyboard manager instance. - * - * Unlike bootstrap modals, the backdrop options is set by default - * to 'static'. - * - * The rest of the options are passed as is to bootstrap modals. - * - * btn_options: dict with the following property: - * - * - click : callback to trigger on click - * - class : css classes to add to button. - * - * - * - **/ - var modal = function (options) { - - var modal = $("
") - .addClass("modal") - .addClass("fade") - .attr("role", "dialog"); - var dialog = $("
") - .addClass("modal-dialog") - .appendTo(modal); - var dialog_content = $("
") - .addClass("modal-content") - .appendTo(dialog); - if(typeof(options.body) === 'string' && options.sanitize !== false){ - options.body = $("

").text(options.body); - } - dialog_content.append( - $("

") - .addClass("modal-header") - .mousedown(function() { - $(".modal").draggable({handle: '.modal-header'}); - }) - .append($("