Skip to content

Commit 6f7f2f1

Browse files
authored
Merge pull request #757 from blink1073/add-pytest-opts
2 parents c5c0b80 + b03a5b2 commit 6f7f2f1

File tree

7 files changed

+94
-18
lines changed

7 files changed

+94
-18
lines changed

.github/workflows/main.yml

Lines changed: 72 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,15 @@ jobs:
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
os: [ubuntu-latest, macos-latest, windows-latest]
55-
python-version: [3.7, 3.8, 3.9, "3.10"]
54+
os: [ubuntu-latest, windows-latest, macos-latest]
55+
python-version: ["3.7", "3.10"]
56+
include:
57+
- os: windows-latest
58+
python-version: "3.9"
59+
- os: ubuntu-latest
60+
python-version: "pypy-3.8"
61+
- os: macos-latest
62+
python-version: "3.8"
5663

5764
env:
5865
OS: ${{ matrix.os }}
@@ -72,17 +79,34 @@ jobs:
7279
- name: Check types
7380
run: mypy jupyter_client --exclude '\/tests|kernelspecapp|ioloop|runapp' --install-types --non-interactive
7481

75-
- name: Run the tests with coverage
76-
run: pytest --cov jupyter_client -v jupyter_client
82+
- name: Run the tests
83+
if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }}
84+
run: |
85+
args="-vv --cov jupyter_client --cov-branch --cov-report term-missing:skip-covered --cov-fail-under 70"
86+
python -m pytest $args || python -m pytest $args --lf
87+
- name: Run the tests on pypy and windows
88+
if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }}
89+
run: |
90+
python -m pytest -vv || python -m pytest -vv --lf
91+
92+
- name: Code coverage
93+
run: codecov
94+
95+
docs:
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v2
100+
101+
- name: Base Setup
102+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
77103

78104
- name: Build the docs
79105
run: |
80106
pip install -r requirements-doc.txt
107+
pip install .
81108
cd docs
82-
make html
83-
84-
- name: Code coverage
85-
run: codecov
109+
make html SPHINXOPTS="-W"
86110
87111
test_miniumum_verisons:
88112
name: Test Minimum Versions
@@ -116,3 +140,43 @@ jobs:
116140
- name: Run the tests
117141
run: |
118142
pytest -vv jupyter_client || pytest -vv jupyter_client --lf
143+
144+
make_sdist:
145+
name: Make SDist
146+
runs-on: ubuntu-latest
147+
timeout-minutes: 20
148+
steps:
149+
- uses: actions/checkout@v2
150+
- name: Base Setup
151+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
152+
- name: Build SDist
153+
run: |
154+
pip install build
155+
python -m build --sdist
156+
- uses: actions/upload-artifact@v2
157+
with:
158+
name: "sdist"
159+
path: dist/*.tar.gz
160+
161+
test_sdist:
162+
runs-on: ubuntu-latest
163+
needs: [make_sdist]
164+
name: Install from SDist and Test
165+
timeout-minutes: 20
166+
steps:
167+
- name: Base Setup
168+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
169+
- name: Download sdist
170+
uses: actions/download-artifact@v2
171+
- name: Install From SDist
172+
run: |
173+
set -ex
174+
cd sdist
175+
mkdir test
176+
tar --strip-components=1 -zxvf *.tar.gz -C ./test
177+
cd test
178+
pip install .[test]
179+
- name: Run Test
180+
run: |
181+
cd sdist/test
182+
pytest -vv || pytest -vv --lf

CHANGELOG.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,15 +532,15 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/5.1)
532532

533533
## 5.0
534534

535-
#### 5.0.1
535+
### 5.0.1
536536

537537
[5.0.1 on
538538
GitHub](https://github.com/jupyter/jupyter_client/milestones/5.0.1)
539539

540540
- Update internal protocol version number to 5.1, which should have
541541
been done in 5.0.0.
542542

543-
#### 5.0.0
543+
### 5.0.0
544544

545545
[5.0.0 on
546546
GitHub](https://github.com/jupyter/jupyter_client/milestones/5.0)
@@ -590,7 +590,7 @@ Backward-incompatible changes:
590590

591591
## 4.4
592592

593-
#### 4.4.0
593+
### 4.4.0
594594

595595
[4.4 on
596596
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.4)
@@ -603,7 +603,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.4)
603603

604604
## 4.3
605605

606-
#### 4.3.0
606+
### 4.3.0
607607

608608
[4.3 on
609609
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.3)
@@ -614,21 +614,21 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.3)
614614

615615
## 4.2
616616

617-
#### 4.2.2
617+
### 4.2.2
618618

619619
[4.2.2 on
620620
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2.2)
621621

622622
- Another fix for the `start_new_kernel` issue in 4.2.1 affecting slow-starting kernels.
623623

624-
#### 4.2.1
624+
### 4.2.1
625625

626626
[4.2.1 on
627627
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2.1)
628628

629629
- Fix regression in 4.2 causing `start_new_kernel` to fail while waiting for kernels to become available.
630630

631-
#### 4.2.0
631+
### 4.2.0
632632

633633
[4.2.0 on
634634
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2)
@@ -645,7 +645,7 @@ GitHub](https://github.com/jupyter/jupyter_client/milestones/4.2)
645645

646646
## 4.1
647647

648-
#### 4.1.0
648+
### 4.1.0
649649

650650
[4.1.0 on
651651
GitHub](https://github.com/jupyter/jupyter_client/milestones/4.1)

docs/provisioning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _provisioning
1+
.. _provisioning:
22

33
Customizing the kernel's runtime environment
44
============================================

docs/wrapperkernels.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ You can override a number of other methods to improve the functionality of your
134134
kernel. All of these methods should return a dictionary as described in the
135135
relevant section of the :doc:`messaging spec <messaging>`.
136136

137-
.. class:: MyKernel
137+
.. class:: MyCustomKernel
138138

139139
.. method:: do_complete(code, cursor_pos)
140140

jupyter_client/tests/test_session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Distributed under the terms of the Modified BSD License.
44
import hmac
55
import os
6+
import platform
67
import uuid
78
from datetime import datetime
89
from unittest import mock
@@ -164,6 +165,7 @@ def test_args(self):
164165
self.assertEqual(s.session, u)
165166
self.assertEqual(s.username, "carrot")
166167

168+
@pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason='Test fails on PyPy')
167169
def test_tracking(self):
168170
"""test tracking messages"""
169171
a, b = self.create_bound_pair(zmq.PAIR, zmq.PAIR)

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ tag_template = "v{new_version}"
2727

2828
[[tool.tbump.file]]
2929
src = "jupyter_client/_version.py"
30+
31+
[tool.pytest.ini_options]
32+
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
33+
testpaths = [
34+
"jupyter_client/tests/"
35+
]
36+
timeout = 300
37+
# Restore this setting to debug failures
38+
# timeout_method = "thread"

requirements-doc.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ipykernel
12
myst-parser
23
sphinx>=1.3.6
34
sphinx_rtd_theme

0 commit comments

Comments
 (0)