| 1 |
name: ipykernel tests |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: ["main"] |
| 6 |
pull_request: |
| 7 |
schedule: |
| 8 |
- cron: "0 0 * * *" |
| 9 |
|
| 10 |
concurrency: |
| 11 |
group: ci-${{ github.ref }} |
| 12 |
cancel-in-progress: true |
| 13 |
|
| 14 |
defaults: |
| 15 |
run: |
| 16 |
shell: bash -eux {0} |
| 17 |
|
| 18 |
jobs: |
| 19 |
build: |
| 20 |
runs-on: ${{ matrix.os }} |
| 21 |
strategy: |
| 22 |
fail-fast: false |
| 23 |
matrix: |
| 24 |
os: [ubuntu-latest, windows-latest, macos-latest] |
| 25 |
qt: |
| 26 |
- qt5 |
| 27 |
- qt6 |
| 28 |
python-version: |
| 29 |
- "3.10" |
| 30 |
- "3.11" |
| 31 |
- "3.12" |
| 32 |
- "3.13" |
| 33 |
- "3.14" |
| 34 |
# 3.14t needs a jupyter-core release |
| 35 |
# - "3.14t" |
| 36 |
- "pypy-3.11" |
| 37 |
exclude: |
| 38 |
# qt6 not supported on 3.14 yet |
| 39 |
- python-version: "3.14" |
| 40 |
qt: qt6 |
| 41 |
- python-version: "3.13" |
| 42 |
qt: qt5 |
| 43 |
- python-version: "3.12" |
| 44 |
qt: qt5 |
| 45 |
- python-version: "3.11" |
| 46 |
qt: qt5 |
| 47 |
|
| 48 |
steps: |
| 49 |
- name: Checkout |
| 50 |
uses: actions/checkout@v6 |
| 51 |
|
| 52 |
- uses: actions/setup-python@v6 |
| 53 |
with: |
| 54 |
python-version: ${{ matrix.python-version }} |
| 55 |
|
| 56 |
- name: set qt env |
| 57 |
run: | |
| 58 |
echo "QT=${{ matrix.qt }}" >> $GITHUB_ENV |
| 59 |
shell: bash |
| 60 |
|
| 61 |
- name: Install hatch |
| 62 |
run: | |
| 63 |
python --version |
| 64 |
python -m pip install hatch |
| 65 |
|
| 66 |
- name: Run the tests |
| 67 |
timeout-minutes: 15 |
| 68 |
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }} |
| 69 |
run: | |
| 70 |
hatch run cov:test --cov-fail-under 50 |
| 71 |
|
| 72 |
- name: Run the tests on pypy |
| 73 |
timeout-minutes: 15 |
| 74 |
if: ${{ startsWith( matrix.python-version, 'pypy' ) }} |
| 75 |
run: | |
| 76 |
hatch run test:nowarn --ignore=tests/test_debugger.py |
| 77 |
|
| 78 |
- name: Run the tests on Windows |
| 79 |
timeout-minutes: 15 |
| 80 |
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && startsWith(matrix.os, 'windows') }} |
| 81 |
run: | |
| 82 |
hatch run cov:nowarn |
| 83 |
|
| 84 |
- name: Check Launcher |
| 85 |
run: | |
| 86 |
pip install . |
| 87 |
cd $HOME |
| 88 |
python -m ipykernel_launcher --help |
| 89 |
|
| 90 |
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1 |
| 91 |
|
| 92 |
coverage: |
| 93 |
runs-on: ubuntu-latest |
| 94 |
needs: |
| 95 |
- build |
| 96 |
steps: |
| 97 |
- uses: actions/checkout@v6 |
| 98 |
- uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1 |
| 99 |
with: |
| 100 |
fail_under: 80 |
| 101 |
|
| 102 |
test_lint: |
| 103 |
name: Test Lint |
| 104 |
runs-on: ubuntu-latest |
| 105 |
steps: |
| 106 |
- uses: actions/checkout@v6 |
| 107 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 108 |
- name: Run Linters |
| 109 |
run: | |
| 110 |
hatch run typing:test |
| 111 |
hatch run lint:build |
| 112 |
pipx run interrogate -vv . |
| 113 |
pipx run doc8 --max-line-length=200 |
| 114 |
|
| 115 |
check_release: |
| 116 |
runs-on: ubuntu-latest |
| 117 |
steps: |
| 118 |
- uses: actions/checkout@v6 |
| 119 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 120 |
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 |
| 121 |
with: |
| 122 |
token: ${{ secrets.GITHUB_TOKEN }} |
| 123 |
|
| 124 |
test_docs: |
| 125 |
runs-on: ubuntu-latest |
| 126 |
steps: |
| 127 |
- uses: actions/checkout@v6 |
| 128 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 129 |
- name: Build API docs |
| 130 |
run: | |
| 131 |
hatch run docs:api |
| 132 |
# If this fails run `hatch run docs:api` locally |
| 133 |
# and commit. |
| 134 |
git status --porcelain |
| 135 |
git status -s | grep "A" && exit 1 |
| 136 |
git status -s | grep "M" && exit 1 |
| 137 |
echo "API docs done" |
| 138 |
- run: hatch run docs:build |
| 139 |
|
| 140 |
test_without_debugpy: |
| 141 |
runs-on: ${{ matrix.os }} |
| 142 |
strategy: |
| 143 |
fail-fast: false |
| 144 |
matrix: |
| 145 |
os: [ubuntu-latest] |
| 146 |
python-version: ["3.10"] |
| 147 |
steps: |
| 148 |
- name: Checkout |
| 149 |
uses: actions/checkout@v6 |
| 150 |
|
| 151 |
- name: Base Setup |
| 152 |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 153 |
|
| 154 |
- name: Install the Python dependencies without debugpy |
| 155 |
run: | |
| 156 |
pip install .[test] |
| 157 |
pip uninstall --yes debugpy |
| 158 |
|
| 159 |
- name: List installed packages |
| 160 |
run: | |
| 161 |
pip freeze |
| 162 |
|
| 163 |
- name: Run the tests |
| 164 |
timeout-minutes: 15 |
| 165 |
run: pytest -W default -vv |
| 166 |
|
| 167 |
test_miniumum_versions: |
| 168 |
name: Test Minimum Versions |
| 169 |
timeout-minutes: 20 |
| 170 |
runs-on: ubuntu-latest |
| 171 |
steps: |
| 172 |
- uses: actions/checkout@v6 |
| 173 |
- name: Base Setup |
| 174 |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 175 |
with: |
| 176 |
dependency_type: minimum |
| 177 |
python_version: "3.10" |
| 178 |
|
| 179 |
- name: List installed packages |
| 180 |
run: | |
| 181 |
hatch -v run test:list |
| 182 |
|
| 183 |
- name: Run the unit tests |
| 184 |
run: | |
| 185 |
hatch -v run test:nowarn |
| 186 |
|
| 187 |
test_prereleases: |
| 188 |
name: Test Prereleases |
| 189 |
runs-on: ubuntu-latest |
| 190 |
timeout-minutes: 20 |
| 191 |
steps: |
| 192 |
- name: Checkout |
| 193 |
uses: actions/checkout@v6 |
| 194 |
- name: Base Setup |
| 195 |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 196 |
with: |
| 197 |
dependency_type: pre |
| 198 |
- name: Run the tests |
| 199 |
run: | |
| 200 |
hatch run test:nowarn |
| 201 |
|
| 202 |
make_sdist: |
| 203 |
name: Make SDist |
| 204 |
runs-on: ubuntu-latest |
| 205 |
timeout-minutes: 20 |
| 206 |
steps: |
| 207 |
- uses: actions/checkout@v6 |
| 208 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 209 |
- uses: jupyterlab/maintainer-tools/.github/actions/make-sdist@v1 |
| 210 |
|
| 211 |
test_sdist: |
| 212 |
runs-on: ubuntu-latest |
| 213 |
needs: [make_sdist] |
| 214 |
name: Install from SDist and Test |
| 215 |
timeout-minutes: 20 |
| 216 |
steps: |
| 217 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 218 |
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 |
| 219 |
|
| 220 |
link_check: |
| 221 |
runs-on: ubuntu-latest |
| 222 |
steps: |
| 223 |
- uses: actions/checkout@v6 |
| 224 |
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 |
| 225 |
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 |