diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b6371119a..50d01c41e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,8 +51,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10"] + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.7", "3.10"] + include: + - os: windows-latest + python-version: "3.9" + - os: ubuntu-latest + python-version: "pypy-3.8" + - os: macos-latest + python-version: "3.8" env: OS: ${{ matrix.os }} @@ -72,17 +79,34 @@ jobs: - name: Check types run: mypy jupyter_client --exclude '\/tests|kernelspecapp|ioloop|runapp' --install-types --non-interactive - - name: Run the tests with coverage - run: pytest --cov jupyter_client -v jupyter_client + - name: Run the tests + if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }} + run: | + args="-vv --cov jupyter_client --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70" + python -m pytest $args || python -m pytest $args --lf + - name: Run the tests on pypy and windows + if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }} + run: | + python -m pytest -vv || python -m pytest -vv --lf + + - name: Code coverage + run: codecov + + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Build the docs run: | pip install -r requirements-doc.txt + pip install . cd docs - make html - - - name: Code coverage - run: codecov + make html SPHINXOPTS="-W" test_miniumum_verisons: name: Test Minimum Versions @@ -116,3 +140,43 @@ jobs: - name: Run the tests run: | pytest -vv jupyter_client || pytest -vv jupyter_client --lf + + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v2 + - 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@v2 + 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@v2 + - name: Install From SDist + run: | + set -ex + cd sdist + mkdir test + tar --strip-components=1 -zxvf *.tar.gz -C ./test + cd test + pip install .[test] + - name: Run Test + run: | + cd sdist/test + pytest -vv || pytest -vv --lf diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f75355e1..5d4b79bec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -532,7 +532,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/5.1) ## 5.0 -#### 5.0.1 +### 5.0.1 [5.0.1 on GitHub](https://github.com/jupyter/jupyter_client/milestones/5.0.1) @@ -540,7 +540,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/5.0.1) - Update internal protocol version number to 5.1, which should have been done in 5.0.0. -#### 5.0.0 +### 5.0.0 [5.0.0 on GitHub](https://github.com/jupyter/jupyter_client/milestones/5.0) @@ -590,7 +590,7 @@ Backward-incompatible changes: ## 4.4 -#### 4.4.0 +### 4.4.0 [4.4 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.4) @@ -603,7 +603,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.4) ## 4.3 -#### 4.3.0 +### 4.3.0 [4.3 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.3) @@ -614,21 +614,21 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.3) ## 4.2 -#### 4.2.2 +### 4.2.2 [4.2.2 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2.2) - Another fix for the `start_new_kernel` issue in 4.2.1 affecting slow-starting kernels. -#### 4.2.1 +### 4.2.1 [4.2.1 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2.1) - Fix regression in 4.2 causing `start_new_kernel` to fail while waiting for kernels to become available. -#### 4.2.0 +### 4.2.0 [4.2.0 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2) @@ -645,7 +645,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2) ## 4.1 -#### 4.1.0 +### 4.1.0 [4.1.0 on GitHub](https://github.com/jupyter/jupyter_client/milestones/4.1) diff --git a/docs/provisioning.rst b/docs/provisioning.rst index e7d990dc1..d3586dd86 100644 --- a/docs/provisioning.rst +++ b/docs/provisioning.rst @@ -1,4 +1,4 @@ -.. _provisioning +.. _provisioning: Customizing the kernel's runtime environment ============================================ diff --git a/docs/wrapperkernels.rst b/docs/wrapperkernels.rst index 82a5658ec..ed7a7a8e7 100644 --- a/docs/wrapperkernels.rst +++ b/docs/wrapperkernels.rst @@ -134,7 +134,7 @@ You can override a number of other methods to improve the functionality of your kernel. All of these methods should return a dictionary as described in the relevant section of the :doc:`messaging spec `. -.. class:: MyKernel +.. class:: MyCustomKernel .. method:: do_complete(code, cursor_pos) diff --git a/jupyter_client/tests/test_session.py b/jupyter_client/tests/test_session.py index edf7a2bcd..179c61f0e 100644 --- a/jupyter_client/tests/test_session.py +++ b/jupyter_client/tests/test_session.py @@ -3,6 +3,7 @@ # Distributed under the terms of the Modified BSD License. import hmac import os +import platform import uuid from datetime import datetime from unittest import mock @@ -164,6 +165,7 @@ def test_args(self): self.assertEqual(s.session, u) self.assertEqual(s.username, "carrot") + @pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='Test fails on PyPy') def test_tracking(self): """test tracking messages""" a, b = self.create_bound_pair(zmq.PAIR, zmq.PAIR) diff --git a/pyproject.toml b/pyproject.toml index 2336b4ddd..0ec4eaeed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,3 +27,12 @@ tag_template = "v{new_version}" [[tool.tbump.file]] src = "jupyter_client/_version.py" + +[tool.pytest.ini_options] +addopts = "-raXs --durations 10 --color=yes --doctest-modules" +testpaths = [ + "jupyter_client/tests/" +] +timeout = 300 +# Restore this setting to debug failures +# timeout_method = "thread" diff --git a/requirements-doc.txt b/requirements-doc.txt index 2988e3539..855dc3afb 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -1,3 +1,4 @@ +ipykernel myst-parser sphinx>=1.3.6 sphinx_rtd_theme