Fix Hatch build fails in src directory #703
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing nbclassic | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.13' | |
- name: Lint with Pre-commit | |
uses: pre-commit/[email protected] | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, macos-13, windows-2022] | |
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Base Setup | |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Install pip dependencies | |
run: | | |
pip install -v -e ".[test]" pytest-cov | |
- name: Check pip environment | |
run: | | |
pip freeze | |
pip check | |
- name: Run the help command | |
run: | | |
jupyter nbclassic -h | |
- name: Test with pytest and coverage | |
run: | | |
python -m pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered || python -m pytest -vv --cov=nbclassic --cov-report term-missing:skip-covered | |
- name: Test Running Server | |
if: startsWith(runner.os, 'Linux') | |
run: | | |
jupyter nbclassic --no-browser & | |
TASK_PID=$! | |
# Make sure the task is running | |
ps -p $TASK_PID || exit 1 | |
sleep 5 | |
kill $TASK_PID | |
wait $TASK_PID | |
# test_miniumum_versions: | |
# name: Test Minimum Versions | |
# timeout-minutes: 20 | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - name: Base Setup | |
# uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
# with: | |
# python_version: "3.8" | |
# - name: Install minimum versions | |
# uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1 | |
# - name: Run the unit tests | |
# run: pytest -vv || pytest -vv --lf | |
test_prereleases: | |
name: Test Prereleases | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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 | |
- name: Run the tests | |
run: | | |
pytest -vv || pytest -vv --lf | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- 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@v4 | |
with: | |
name: "sdist" | |
path: dist/*.tar.gz | |
test_sdist: | |
runs-on: ubuntu-latest | |
needs: [make_sdist] | |
name: Install from SDist and Test | |
timeout-minutes: 20 | |
steps: | |
- name: Base Setup | |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Download sdist | |
uses: actions/download-artifact@v4 | |
- name: Install From SDist | |
run: | | |
set -ex | |
cd sdist | |
mkdir test | |
tar --strip-components=1 -zxvf *.tar.gz -C ./test | |
cd test | |
pip install -e .[test] | |
pip install pytest-github-actions-annotate-failures | |
- name: Run Test | |
run: | | |
cd sdist/test | |
pytest -vv || pytest -vv --lf | |
test_offline_build: | |
runs-on: ubuntu-latest | |
needs: [make_sdist] | |
name: Test building offline | |
timeout-minutes: 20 | |
steps: | |
- name: Base Setup | |
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | |
- name: Download sdist | |
uses: actions/download-artifact@v4 | |
- name: Install From SDist | |
run: | | |
set -ex | |
cd sdist | |
mkdir test | |
tar --strip-components=1 -zxvf *.tar.gz -C ./test | |
- name: Test offline build with unshare | |
run: | | |
# Use unshare to create a network namespace that blocks network access | |
cd sdist/test | |
python -m venv .venv | |
.venv/bin/python -m pip install build babel jupyter-server hatch-jupyter-builder | |
sudo unshare --net bash -c ".venv/bin/python -m build --no-isolation --wheel" |