Skip to content

Commit bb1ad85

Browse files
authored
Merge pull request #820 from blink1073/use-downstream-test
Clean up workflows
2 parents ba29677 + d26c614 commit bb1ad85

File tree

5 files changed

+84
-127
lines changed

5 files changed

+84
-127
lines changed

.github/workflows/check-release.yml

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,23 @@ jobs:
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
17-
- name: Install Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: 3.9
21-
architecture: "x64"
22-
- name: Get pip cache dir
23-
id: pip-cache
24-
run: |
25-
echo "::set-output name=dir::$(pip cache dir)"
26-
- name: Cache pip
27-
uses: actions/cache@v2
28-
with:
29-
path: ${{ steps.pip-cache.outputs.dir }}
30-
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
31-
restore-keys: |
32-
${{ runner.os }}-pip-
33-
${{ runner.os }}-pip-
34-
- name: Cache checked links
35-
if: ${{ matrix.group == 'link_check' }}
36-
uses: actions/cache@v2
37-
with:
38-
path: ~/.cache/pytest-link-check
39-
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-md-links
40-
restore-keys: |
41-
${{ runner.os }}-linkcheck-
42-
- name: Upgrade packaging dependencies
43-
run: |
44-
pip install --upgrade pip setuptools wheel --user
17+
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Base Setup
22+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
23+
4524
- name: Install Dependencies
4625
run: |
4726
pip install -e .
27+
4828
- name: Check Release
4929
if: ${{ matrix.group == 'check_release' }}
5030
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
5131
with:
5232
token: ${{ secrets.GITHUB_TOKEN }}
33+
5334
- name: Run Link Check
5435
if: ${{ matrix.group == 'link_check' }}
5536
uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1

.github/workflows/ci.yml

Lines changed: 41 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: ipykernel tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: "master"
6+
pull_request:
7+
branches: "*"
48

59
jobs:
610
build:
@@ -9,67 +13,60 @@ jobs:
913
fail-fast: false
1014
matrix:
1115
os: [ubuntu, macos, windows]
12-
python-version: [ '3.7', '3.8', '3.9' ]
16+
python-version: [ '3.7', '3.8', '3.9', '3.10', 'pypy-3.7' ]
1317
exclude:
1418
- os: windows
15-
python-version: pypy3
19+
python-version: pypy-3.7
1620
steps:
1721
- name: Checkout
18-
uses: actions/checkout@v1
19-
- name: Install Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v1
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
architecture: 'x64'
24-
- name: Upgrade packaging dependencies
25-
run: |
26-
pip install --upgrade pip setuptools wheel --user
27-
- name: Get pip cache dir
28-
id: pip-cache
29-
run: |
30-
echo "::set-output name=dir::$(pip cache dir)"
31-
- name: Cache pip
32-
uses: actions/cache@v1
33-
with:
34-
path: ${{ steps.pip-cache.outputs.dir }}
35-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
36-
restore-keys: |
37-
${{ runner.os }}-pip-${{ matrix.python-version }}-
38-
${{ runner.os }}-pip-
22+
uses: actions/checkout@v2
23+
24+
- name: Base Setup
25+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
26+
3927
- name: Install the Python dependencies
4028
run: |
4129
pip install --pre --upgrade --upgrade-strategy=eager .[test] codecov
30+
4231
- name: Install matplotlib
4332
if: ${{ matrix.os != 'macos' && matrix.python-version != 'pypy3' }}
4433
run: |
45-
pip install matplotlib || echo 'failed to install matplolib'
34+
pip install matplotlib || echo 'failed to install matplotlib'
35+
4636
- name: Install alternate event loops
4737
if: ${{ matrix.os != 'windows' }}
4838
run: |
4939
pip install curio || echo 'ignoring curio install failure'
5040
pip install trio || echo 'ignoring trio install failure'
41+
5142
- name: List installed packages
5243
run: |
5344
pip freeze
5445
pip check
46+
5547
- name: Run the tests
5648
timeout-minutes: 10
49+
if: ${{ !startsWith( matrix.python-version, 'pypy' ) }}
5750
run: |
5851
pytest ipykernel -vv -s --cov ipykernel --cov-branch --cov-report term-missing:skip-covered --durations 10
52+
53+
- name: Run the tests on pypy
54+
timeout-minutes: 15
55+
if: ${{ startsWith( matrix.python-version, 'pypy' ) }}
56+
run: |
57+
pytest -vv ipykernel
58+
5959
- name: Build the docs
6060
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.9'}}
6161
run: |
6262
cd docs
6363
pip install -r requirements.txt
6464
make html
65-
- name: Build and check the dist files
66-
run: |
67-
pip install build twine
68-
python -m build .
69-
twine check dist/*
65+
7066
- name: Coverage
7167
run: |
7268
codecov
69+
7370
check_docstrings:
7471
runs-on: ${{ matrix.os }}-latest
7572
strategy:
@@ -82,34 +79,20 @@ jobs:
8279
python-version: pypy3
8380
steps:
8481
- name: Checkout
85-
uses: actions/checkout@v1
86-
- name: Install Python ${{ matrix.python-version }}
87-
uses: actions/setup-python@v1
88-
with:
89-
python-version: ${{ matrix.python-version }}
90-
architecture: 'x64'
91-
- name: Upgrade packaging dependencies
92-
run: |
93-
pip install --upgrade pip setuptools wheel --user
94-
- name: Get pip cache dir
95-
id: pip-cache
96-
run: |
97-
echo "::set-output name=dir::$(pip cache dir)"
98-
- name: Cache pip
99-
uses: actions/cache@v1
100-
with:
101-
path: ${{ steps.pip-cache.outputs.dir }}
102-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
103-
restore-keys: |
104-
${{ runner.os }}-pip-${{ matrix.python-version }}-
105-
${{ runner.os }}-pip-
82+
uses: actions/checkout@v2
83+
84+
- name: Base Setup
85+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
86+
10687
- name: Install the Python dependencies
10788
run: |
10889
pip install --pre --upgrade --upgrade-strategy=eager .
10990
pip install velin
91+
11092
- name: Check Docstrings
11193
run: |
11294
velin . --check --compact
95+
11396
test_without_debugpy:
11497
runs-on: ${{ matrix.os }}-latest
11598
strategy:
@@ -119,34 +102,20 @@ jobs:
119102
python-version: [ '3.9' ]
120103
steps:
121104
- name: Checkout
122-
uses: actions/checkout@v1
123-
- name: Install Python ${{ matrix.python-version }}
124-
uses: actions/setup-python@v1
125-
with:
126-
python-version: ${{ matrix.python-version }}
127-
architecture: 'x64'
128-
- name: Upgrade packaging dependencies
129-
run: |
130-
pip install --upgrade pip setuptools wheel --user
131-
- name: Get pip cache dir
132-
id: pip-cache
133-
run: |
134-
echo "::set-output name=dir::$(pip cache dir)"
135-
- name: Cache pip
136-
uses: actions/cache@v1
137-
with:
138-
path: ${{ steps.pip-cache.outputs.dir }}
139-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
140-
restore-keys: |
141-
${{ runner.os }}-pip-${{ matrix.python-version }}-
142-
${{ runner.os }}-pip-
105+
uses: actions/checkout@v2
106+
107+
- name: Base Setup
108+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
109+
143110
- name: Install the Python dependencies without debugpy
144111
run: |
145112
pip install --pre --upgrade --upgrade-strategy=eager .[test]
146113
pip uninstall --yes debugpy
114+
147115
- name: List installed packages
148116
run: |
149117
pip freeze
118+
150119
- name: Run the tests
151120
timeout-minutes: 10
152121
run: |

.github/workflows/downstream.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,47 @@ name: Test downstream projects
22

33
on:
44
push:
5-
branches: "*"
5+
branches: "master"
66
pull_request:
77
branches: "*"
88

99
jobs:
10-
tests:
10+
downstream1:
1111
runs-on: ubuntu-latest
1212

1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v2
1616

17-
- name: Set up Python 3.9
18-
uses: actions/setup-python@v2
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Test nbclient
21+
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
1922
with:
20-
python-version: 3.9
23+
package_name: nbclient
24+
env_values: IPYKERNEL_CELL_NAME=\<IPY-INPUT\>
2125

22-
- name: Install dependencies
23-
run: |
24-
pip install --upgrade pip
25-
pip install pytest pytest-asyncio pytest-tornado
26-
pip install nbclient[test]
27-
pip install --pre -U --upgrade-strategy=only-if-needed nbclient
28-
pip install ipyparallel[test]
29-
pip install --pre -U --upgrade-strategy=only-if-needed ipyparallel
30-
pip install jupyter_client[test]
31-
pip install --pre -U --upgrade-strategy=only-if-needed jupyter_client
32-
pip install . --force-reinstall
33-
pip freeze
34-
python -c 'import ipykernel; print("ipykernel", ipykernel.__version__)'
26+
- name: Test jupyter_client
27+
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
28+
with:
29+
package_name: jupyter_client
30+
31+
downstream2:
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
38+
- name: Base Setup
39+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
3540

36-
- name: Test nbclient
37-
if: ${{ always() }}
38-
run: IPYKERNEL_CELL_NAME="<IPY-INPUT>" pytest --pyargs nbclient
3941
- name: Test ipyparallel
40-
if: ${{ always() }}
41-
run: pytest --pyargs ipyparallel
42-
- name: Test jupyter_client
43-
if: ${{ always() }}
44-
run: pytest --pyargs jupyter_client
42+
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
43+
with:
44+
package_name: ipyparallel
45+
4546
- name: Test jupyter_kernel_test
4647
run: |
4748
git clone https://github.com/jupyter/jupyter_kernel_test.git

ipykernel/tests/test_kernel.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import ast
77
import io
88
import os.path
9+
import platform
910
import subprocess
1011
import sys
1112
import time
@@ -367,6 +368,10 @@ def test_unc_paths():
367368
assert reply['content']['status'] == 'ok'
368369

369370

371+
@pytest.mark.skipif(
372+
platform.python_implementation() == "PyPy",
373+
reason="does not work on PyPy",
374+
)
370375
def test_shutdown():
371376
"""Kernel exits after polite shutdown_request"""
372377
with new_kernel() as kc:

ipykernel/tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import atexit
77
import os
8+
import platform
89
import sys
910
from tempfile import TemporaryDirectory
1011
from time import time
@@ -17,7 +18,7 @@
1718

1819

1920
STARTUP_TIMEOUT = 60
20-
TIMEOUT = 60
21+
TIMEOUT = 100
2122

2223
KM = None
2324
KC = None

0 commit comments

Comments
 (0)