Skip to content

Commit

Permalink
Merge branch 'main' into cell-anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski authored Dec 18, 2022
2 parents 5fe0682 + a32c3c1 commit ba0e27c
Show file tree
Hide file tree
Showing 51 changed files with 690 additions and 621 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Set update schedule for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
python-version: ["3.7", "3.10"]
steps:
- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -38,7 +38,7 @@ jobs:
cd docs
make html SPHINXOPTS="-W"
- name: Upload HTML
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: html
path: build/sphinx/html
Expand All @@ -47,7 +47,7 @@ jobs:
cd docs
make latexpdf
- name: Upload PDF
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pdf
path: docs/build/latex/nbconvert.pdf
Expand Down
146 changes: 63 additions & 83 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,100 +9,71 @@ concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -eux {0}

jobs:
run-tests:
runs-on: ${{ matrix.os }}
env:
NBFORMAT_VALIDATOR: jsonschema
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
os: ["ubuntu-20.04", "macos-latest", "windows-latest"]
python-version: ["3.7", "3.10"]
include:
- os: "windows-latest"
python-version: "3.8"
- os: "ubuntu-latest"
- os: "ubuntu-20.04"
python-version: "3.9"
fail-fast: false
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Run base setup actions
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge
- name: Install conda-forge python
shell: bash -l {0}
run: |
mamba create -n nbconvert
conda activate nbconvert
mamba install python=${{ matrix.python-version }}
- name: Install conda-forge dependencies
shell: bash -l {0}
run: |
mamba create -n nbconvert
conda activate nbconvert
mamba install pip pyqtwebengine pandoc pyxdg
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get update
sudo apt-get install texlive-plain-generic inkscape texlive-xetex
sudo apt-get install xvfb x11-utils libxkbcommon-x11-0
- name: Install package dependencies
shell: bash -l {0}
run: |
conda activate nbconvert
pip install codecov
pip install -e ".[execute,serve,test]"
which python
python -m ipykernel.kernelspec --sys-prefix
- name: List installed packages
shell: bash -l {0}
run: |
conda activate nbconvert
pip freeze
pip check
sudo apt-get install texlive-plain-generic inkscape texlive-xetex latexmk
sudo apt-get install xvfb x11-utils libxkbcommon-x11-0 libxcb-xinerama0 python3-pyqt5
- name: Run tests on MacOS
if: ${{ startsWith(runner.os, 'macos') }}
shell: bash -l {0}
run: |
conda activate nbconvert
# See https://github.com/pyppeteer/pyppeteer/pull/321
pip install -U websockets
python -m pytest --cov nbconvert -vv
# 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
- name: Run tests on Linux
if: ${{ startsWith(runner.os, 'linux') }}
shell: bash -l {0}
run: |
conda activate nbconvert
# See https://github.com/pyppeteer/pyppeteer/pull/321
pip install -U websockets
NBFORMAT_VALIDATOR=jsonschema xvfb-run --auto-servernum `which coverage` run -m pytest -vv
- name: Run tests on pypy and Windows
if: ${{ startsWith(runner.os, 'Windows') }}
shell: bash -l {0}
xvfb-run --auto-servernum hatch run cov:test
- name: Run tests on other platforms
if: ${{ !startsWith(runner.os, 'linux') }}
run: |
conda activate nbconvert
# See https://github.com/pyppeteer/pyppeteer/pull/321
pip install -U websockets
python -m pytest -vv
hatch run cov:test
- name: Code coverage
shell: bash -l {0}
run: |
conda activate nbconvert
pip install codecov coverage[toml]
codecov
test_lint:
name: Test Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Run Linters
run: |
hatch run lint:style
pipx run 'validate-pyproject[all]' pyproject.toml
pipx run doc8 --max-line-length=200 --ignore-path=docs/source/other/full-config.rst
check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- run: pip install -e .
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
Expand All @@ -114,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
with:
Expand All @@ -124,7 +95,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1

Expand All @@ -133,45 +104,37 @@ jobs:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
python_version: "3.7"
- name: Install miniumum versions
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
dependency_type: minimum
only_create_file: 1
- name: Run the unit tests
run: |
export NBFORMAT_VALIDATOR=jsonschema
pytest -vv -W default || pytest -vv -W default --lf
hatch run test:nowarn || hatch run test:nowarn --lf
test_prereleases:
name: Test Prereleases
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Install the Python dependencies
run: |
pip install --pre -e ".[test]"
- name: List installed packages
run: |
pip freeze
pip check
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
with:
dependency_type: pre
- name: Run the tests
run: |
export NBFORMAT_VALIDATOR=jsonschema
pytest -vv -W default || pytest -vv -W default --lf
hatch run test:nowarn || hatch run test:nowarn --lf
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1

Expand All @@ -183,3 +146,20 @@ jobs:
steps:
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1

tests_check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- run-tests
- pre_commit
- test_minimum_versions
- test_prereleases
- check_links
- check_release
- test_sdist
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) }}
71 changes: 15 additions & 56 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ci:
autoupdate_schedule: monthly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: check-case-conflict
Expand All @@ -15,69 +18,25 @@ repos:
- id: check-builtin-literals
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.10.0
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.2
hooks:
- id: black
args: ["--line-length", "100"]

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
files: \.py$
args: [--profile=black]
stages: [manual]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.10.1
hooks:
- id: validate-pyproject
stages: [manual]
- id: check-github-workflows

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
hooks:
- id: mdformat

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
hooks:
- id: doc8
args: [--max-line-length=200]
stages: [manual]

- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.1.0.post0
hooks:
- id: Flake8-pyproject
alias: flake8
additional_dependencies:
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
stages: [manual]
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.18.4
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
stages: [manual]
- id: black

- repo: local
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.181
hooks:
- id: check-pyproject
name: check pyproject file
language: python
entry: python -m check_requirements
files: ^pyproject.toml$
stages: [manual]
additional_dependencies: ["tomli"]
- id: ruff
args: ["--fix"]
7 changes: 3 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ sphinx:

formats: all

conda:
environment: docs/environment.yml

build:
image: latest

python:
version: 3.7
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
Loading

0 comments on commit ba0e27c

Please sign in to comment.