mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
commit
1b50ded5a9
6
.github/actions/build-dist/action.yml
vendored
6
.github/actions/build-dist/action.yml
vendored
@ -9,18 +9,18 @@ runs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade jupyter_packaging~=0.10 "jupyterlab>=4.0.0a30,<5" build
|
python -m pip install hatch
|
||||||
|
|
||||||
- name: Build pypi distributions
|
- name: Build pypi distributions
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python -m build
|
hatch build
|
||||||
|
|
||||||
- name: Build npm distributions
|
- name: Build npm distributions
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir pkgs
|
mkdir pkgs
|
||||||
jlpm lerna exec -- npm pack
|
hatch run npm_pack
|
||||||
cp packages/*/*.tgz pkgs
|
cp packages/*/*.tgz pkgs
|
||||||
|
|
||||||
- name: Build checksum file
|
- name: Build checksum file
|
||||||
|
90
.github/workflows/build.yml
vendored
90
.github/workflows/build.yml
vendored
@ -39,52 +39,66 @@ jobs:
|
|||||||
|
|
||||||
- name: Base Setup
|
- name: Base Setup
|
||||||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
||||||
with:
|
|
||||||
python_version: "3.11"
|
|
||||||
|
|
||||||
- name: Install the package
|
- name: Test the package
|
||||||
run: |
|
run: hatch run cov:test
|
||||||
python -m pip install ".[dev,test]"
|
|
||||||
jlpm run build:test
|
|
||||||
|
|
||||||
- name: Unit tests
|
- name: JavaScript tests
|
||||||
run: |
|
run: |
|
||||||
jlpm run test
|
hatch run js_test
|
||||||
pytest -vv || pytest -vv --lf
|
|
||||||
|
|
||||||
- name: Integration Tests
|
- name: Integration Tests
|
||||||
run: |
|
run: |
|
||||||
|
pip install .
|
||||||
|
cd
|
||||||
jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" -
|
jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" -
|
||||||
jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" -
|
jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" -
|
||||||
python -m jupyterlab.browser_check
|
python -m jupyterlab.browser_check
|
||||||
|
|
||||||
test_prerelease:
|
test_docs:
|
||||||
|
name: Test Docs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
||||||
|
- run: |
|
||||||
|
# pandoc is not up to date in the ubuntu repos, so we install directly
|
||||||
|
wget https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-1-amd64.deb && sudo dpkg -i pandoc-2.14.2-1-amd64.deb
|
||||||
|
- run: hatch run docs:build
|
||||||
|
|
||||||
- name: Base Setup
|
test_minimum_versions:
|
||||||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
name: Test Minimum Versions
|
||||||
with:
|
timeout-minutes: 20
|
||||||
python_version: "3.10"
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
||||||
|
with:
|
||||||
|
python_version: "3.7"
|
||||||
|
- uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
|
||||||
|
with:
|
||||||
|
only_create_file: 1
|
||||||
|
- name: Run the unit tests
|
||||||
|
run: |
|
||||||
|
hatch run test:nowarn || hatch run test:nowarn --lf
|
||||||
|
|
||||||
- name: Install the Python dependencies
|
test_prereleases:
|
||||||
run: |
|
name: Test Prereleases
|
||||||
pip install --no-deps .
|
runs-on: ubuntu-latest
|
||||||
pip install --pre --upgrade ".[dev,test]"
|
timeout-minutes: 20
|
||||||
python -m pip install ".[dev,test]"
|
steps:
|
||||||
jlpm run build:test
|
- uses: actions/checkout@v3
|
||||||
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
||||||
- name: Python Unit tests
|
with:
|
||||||
run: |
|
python_version: "3.11"
|
||||||
pytest -vv || pytest -vv --lf
|
- name: Run the tests
|
||||||
|
run: |
|
||||||
|
PIP_PRE=1 hatch run test:nowarn || hatch run test:nowarn --lf
|
||||||
|
|
||||||
install:
|
install:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 15
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -131,7 +145,7 @@ jobs:
|
|||||||
jupyter notebook --version
|
jupyter notebook --version
|
||||||
jupyter notebook --help
|
jupyter notebook --help
|
||||||
|
|
||||||
link_check:
|
check_links:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
@ -149,3 +163,21 @@ jobs:
|
|||||||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
||||||
- run: pip install -e .
|
- run: pip install -e .
|
||||||
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
|
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
|
||||||
|
|
||||||
|
|
||||||
|
tests_check: # This job does nothing and is only used for the branch protection
|
||||||
|
if: always()
|
||||||
|
needs:
|
||||||
|
- test
|
||||||
|
- install
|
||||||
|
- pre_commit
|
||||||
|
- test_docs
|
||||||
|
- test_minimum_versions
|
||||||
|
- test_prereleases
|
||||||
|
- check_links
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Decide whether the needed jobs succeeded or failed
|
||||||
|
uses: re-actors/alls-green@release/v1
|
||||||
|
with:
|
||||||
|
jobs: ${{ toJSON(needs) }}
|
||||||
|
38
.github/workflows/docs.yml
vendored
38
.github/workflows/docs.yml
vendored
@ -1,38 +0,0 @@
|
|||||||
name: Docs Tests
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ['main']
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 10
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Base Setup
|
|
||||||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
|
|
||||||
with:
|
|
||||||
python_version: '3.7'
|
|
||||||
- name: Install the Python dependencies
|
|
||||||
run: |
|
|
||||||
pip install -e .[dev,test] codecov
|
|
||||||
pip install -r docs/doc-requirements.txt
|
|
||||||
wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb
|
|
||||||
- name: List installed packages
|
|
||||||
run: |
|
|
||||||
pip freeze
|
|
||||||
pip check
|
|
||||||
- name: Run tests on documentation
|
|
||||||
run: |
|
|
||||||
EXIT_STATUS=0
|
|
||||||
make -C docs/ html SPHINXOPTS="-W" || EXIT_STATUS=$?
|
|
||||||
# Ignore warnings to work around
|
|
||||||
# # https://github.com/computationalmodelling/nbval/issues/180
|
|
||||||
pytest --nbval --current-env -W default docs || EXIT_STATUS=$?
|
|
||||||
exit $EXIT_STATUS
|
|
@ -56,15 +56,10 @@ repos:
|
|||||||
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
|
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
|
|
||||||
- repo: https://github.com/sirosen/check-jsonschema
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||||
rev: 0.19.1
|
rev: 0.19.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-jsonschema
|
- id: check-github-workflows
|
||||||
name: 'Check GitHub Workflows'
|
|
||||||
files: ^\.github/workflows/
|
|
||||||
types: [yaml]
|
|
||||||
args: ['--schemafile', 'https://json.schemastore.org/github-workflow']
|
|
||||||
stages: [manual]
|
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
conda:
|
version: 2
|
||||||
file: docs/environment.yml
|
sphinx:
|
||||||
|
configuration: docs/source/conf.py
|
||||||
|
build:
|
||||||
|
os: ubuntu-20.04
|
||||||
|
tools:
|
||||||
|
python: "3.9"
|
||||||
|
nodejs: "16"
|
||||||
python:
|
python:
|
||||||
version: 3
|
install:
|
||||||
|
# install notebook itself
|
||||||
|
- method: pip
|
||||||
|
path: ".[docs]"
|
||||||
|
@ -3,7 +3,7 @@ coverage:
|
|||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
target: auto
|
target: auto
|
||||||
threshold: 10
|
threshold: 1
|
||||||
patch:
|
patch:
|
||||||
default:
|
default:
|
||||||
target: 0%
|
target: 0%
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
myst_parser
|
|
||||||
nbsphinx
|
|
||||||
pydata-sphinx-theme
|
|
||||||
sphinx>=1.3.6
|
|
||||||
sphinxcontrib_github_alt
|
|
@ -1,20 +0,0 @@
|
|||||||
name: notebook_docs
|
|
||||||
channels:
|
|
||||||
- conda-forge
|
|
||||||
dependencies:
|
|
||||||
- python=3.8
|
|
||||||
- pydata-sphinx-theme
|
|
||||||
- jinja2
|
|
||||||
- tornado
|
|
||||||
- nbformat
|
|
||||||
- jupyter_client
|
|
||||||
- ipykernel
|
|
||||||
- pip
|
|
||||||
- sphinx
|
|
||||||
- terminado
|
|
||||||
- myst-parser
|
|
||||||
- pip:
|
|
||||||
- nbsphinx
|
|
||||||
- Send2Trash
|
|
||||||
- prometheus_client
|
|
||||||
- sphinxcontrib_github_alt
|
|
@ -31,6 +31,7 @@ classifiers = [
|
|||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jupyter_server>=2.0.0rc3,<3",
|
"jupyter_server>=2.0.0rc3,<3",
|
||||||
|
"importlib-resources>=5.0;python_version<\"3.9\"",
|
||||||
"jupyterlab>=4.0.0a31,<5",
|
"jupyterlab>=4.0.0a31,<5",
|
||||||
"jupyterlab_server>=2.16.3,<3",
|
"jupyterlab_server>=2.16.3,<3",
|
||||||
"notebook_shim>=0.2,<0.3",
|
"notebook_shim>=0.2,<0.3",
|
||||||
@ -51,7 +52,7 @@ Tracker = "https://github.com/jupyter/notebook/issues"
|
|||||||
test = [
|
test = [
|
||||||
"coverage",
|
"coverage",
|
||||||
"nbval",
|
"nbval",
|
||||||
"pytest>=6.0",
|
"pytest>=7.0",
|
||||||
"pytest-cov",
|
"pytest-cov",
|
||||||
"requests",
|
"requests",
|
||||||
"pytest-tornasync",
|
"pytest-tornasync",
|
||||||
@ -61,6 +62,13 @@ test = [
|
|||||||
"jupyter_server[test]>=2.0.0rc3,<3",
|
"jupyter_server[test]>=2.0.0rc3,<3",
|
||||||
"jupyterlab_server[test]>=2.16.3,<3",
|
"jupyterlab_server[test]>=2.16.3,<3",
|
||||||
]
|
]
|
||||||
|
docs = [
|
||||||
|
"myst_parser",
|
||||||
|
"nbsphinx",
|
||||||
|
"pydata-sphinx-theme",
|
||||||
|
"sphinx>=1.3.6",
|
||||||
|
"sphinxcontrib_github_alt",
|
||||||
|
]
|
||||||
dev = [
|
dev = [
|
||||||
"pre-commit",
|
"pre-commit",
|
||||||
"hatch"
|
"hatch"
|
||||||
@ -99,6 +107,27 @@ artifacts = [
|
|||||||
]
|
]
|
||||||
include = ["/notebook"]
|
include = ["/notebook"]
|
||||||
|
|
||||||
|
[tool.hatch.envs.docs]
|
||||||
|
features = ["docs"]
|
||||||
|
[tool.hatch.envs.docs.scripts]
|
||||||
|
build = "make -C docs html SPHINXOPTS='-W'"
|
||||||
|
|
||||||
|
[tool.hatch.envs.default.scripts]
|
||||||
|
npm_pack = "jlpm lerna exec -- npm pack"
|
||||||
|
js_test = "jlpm run build:test && jlpm run test"
|
||||||
|
|
||||||
|
[tool.hatch.envs.test]
|
||||||
|
features = ["test"]
|
||||||
|
[tool.hatch.envs.test.scripts]
|
||||||
|
test = "python -m pytest -vv {args}"
|
||||||
|
nowarn = "test -W default {args}"
|
||||||
|
|
||||||
|
[tool.hatch.envs.cov]
|
||||||
|
features = ["test"]
|
||||||
|
dependencies = ["coverage", "pytest-cov"]
|
||||||
|
[tool.hatch.envs.cov.scripts]
|
||||||
|
test = "python -m pytest -vv --cov notebook --cov-branch --cov-report term-missing:skip-covered {args}"
|
||||||
|
nowarn = "test -W default {args}"
|
||||||
|
|
||||||
[tool.hatch.build.hooks.jupyter-builder]
|
[tool.hatch.build.hooks.jupyter-builder]
|
||||||
dependencies = ["hatch-jupyter-builder>=0.2"]
|
dependencies = ["hatch-jupyter-builder>=0.2"]
|
||||||
@ -129,6 +158,20 @@ filterwarnings = [
|
|||||||
"ignore:clear_current is deprecated"
|
"ignore:clear_current is deprecated"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.coverage.report]
|
||||||
|
exclude_lines = [
|
||||||
|
"pragma: no cover",
|
||||||
|
"def __repr__",
|
||||||
|
"if self.debug:",
|
||||||
|
"if settings.DEBUG",
|
||||||
|
"raise AssertionError",
|
||||||
|
"raise NotImplementedError",
|
||||||
|
"if 0:",
|
||||||
|
"if __name__ == .__main__.:",
|
||||||
|
"class .*\bProtocol\\):",
|
||||||
|
"@(abc\\.)?abstractmethod",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.flake8]
|
[tool.flake8]
|
||||||
ignore = "E501, W503, E402"
|
ignore = "E501, W503, E402"
|
||||||
builtins = "c, get_config"
|
builtins = "c, get_config"
|
||||||
|
@ -4,7 +4,11 @@ import os
|
|||||||
import os.path as osp
|
import os.path as osp
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
from importlib.resources import files
|
|
||||||
|
try:
|
||||||
|
from importlib.resources import files
|
||||||
|
except ImportError:
|
||||||
|
from importlib_resources import files
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user