Skip to content

Commit c5ce7bf

Browse files
authored
Add windows coverage and clean up workflows (#1023)
1 parent dbea8f2 commit c5ce7bf

6 files changed

Lines changed: 44 additions & 63 deletions

File tree

.github/workflows/check-release.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,23 @@ jobs:
3737
- name: Base Setup
3838
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
3939

40-
- name: Install the Python dependencies
41-
run: |
42-
pip install .[test] codecov
43-
44-
- name: Install matplotlib
45-
if: ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
46-
run: |
47-
pip install matplotlib || echo 'failed to install matplotlib'
48-
49-
- name: Install alternate event loops
50-
if: ${{ !startsWith(matrix.os, 'windows') }}
51-
run: |
52-
pip install curio || echo 'ignoring curio install failure'
53-
pip install trio || echo 'ignoring trio install failure'
54-
55-
- name: List installed packages
56-
run: |
57-
pip uninstall pipx -y
58-
pip install pipdeptree
59-
pipdeptree
60-
pipdeptree --reverse
61-
pip freeze
62-
pip check
63-
6440
- name: Run the tests
6541
timeout-minutes: 15
6642
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
6743
run: |
68-
hatch run cov:test || hatch run test:test --lf
44+
hatch run cov:test --cov-fail-under 50 || hatch run test:test --lf
45+
46+
- name: Run the tests on pypy
47+
timeout-minutes: 15
48+
if: ${{ startsWith( matrix.python-version, 'pypy' ) }}
49+
run: |
50+
hatch run test:nowarn || hatch run test:nowarn --lf
6951
70-
- name: Run the tests on pypy and windows
52+
- name: Run the tests on Windows
7153
timeout-minutes: 15
72-
if: ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
54+
if: ${{ startsWith(matrix.os, 'windows') }}
7355
run: |
74-
pip install -e ".[test]"
75-
pytest -vv || pytest -vv --lf
56+
hatch run cov:nowarn || hatch run test:nowarn --lf
7657
7758
- name: Coverage
7859
run: |
@@ -81,6 +62,7 @@ jobs:
8162
8263
- name: Check Launcher
8364
run: |
65+
pip install .
8466
cd $HOME
8567
python -m ipykernel_launcher --help
8668
@@ -91,6 +73,15 @@ jobs:
9173
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
9274
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
9375

76+
check_release:
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v3
80+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
81+
- uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
82+
with:
83+
token: ${{ secrets.GITHUB_TOKEN }}
84+
9485
test_docs:
9586
runs-on: ubuntu-latest
9687
steps:
@@ -123,7 +114,7 @@ jobs:
123114
124115
- name: Run the tests
125116
timeout-minutes: 10
126-
run: hatch run test:test
117+
run: pytest -W default -vv || pytest --vv -W default --lf
127118

128119
test_miniumum_versions:
129120
name: Test Minimum Versions
@@ -137,9 +128,12 @@ jobs:
137128
python_version: "3.8"
138129
- name: Install miniumum versions
139130
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
131+
with:
132+
only_create_file: 1
140133
- name: Run the unit tests
141134
run: |
142-
pytest -vv -W default || pytest -vv -W default --lf
135+
export PIP_CONSTRAINT="./contraints_file.txt"
136+
hatch run test:nowarn || hatch run test:nowarn --lf
143137
144138
test_prereleases:
145139
name: Test Prereleases
@@ -150,16 +144,10 @@ jobs:
150144
uses: actions/checkout@v3
151145
- name: Base Setup
152146
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
153-
- name: Install the Python dependencies
154-
run: |
155-
pip install --pre -e ".[test]"
156-
- name: List installed packages
157-
run: |
158-
pip freeze
159-
pip check
160147
- name: Run the tests
161148
run: |
162-
pytest -vv -W default || pytest -vv -W default --lf
149+
export PIP_PRE=1
150+
hatch run test:nowarn || hatch run test:nowarn --lf
163151
164152
make_sdist:
165153
name: Make SDist
@@ -195,6 +183,7 @@ jobs:
195183
- test_miniumum_versions
196184
- pre_commit
197185
- test_prereleases
186+
- check_release
198187
- link_check
199188
- test_sdist
200189
runs-on: ubuntu-latest

ipykernel/tests/test_embed_kernel.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from contextlib import contextmanager
1111
from subprocess import PIPE, Popen
1212

13+
import pytest
1314
from flaky import flaky
1415
from jupyter_client import BlockingKernelClient
1516
from jupyter_core import paths
@@ -18,6 +19,10 @@
1819
TIMEOUT = 15
1920

2021

22+
if os.name == "nt":
23+
pytest.skip("skipping tests on windows", allow_module_level=True)
24+
25+
2126
@contextmanager
2227
def setup_kernel(cmd):
2328
"""start an embedded kernel in a subprocess, and wait for it to be ready

ipykernel/tests/test_eventloop.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import os
5+
import sys
56
import threading
67
import time
78

@@ -54,6 +55,7 @@ def test_asyncio_interrupt():
5455

5556

5657
@windows_skip
58+
@pytest.mark.skipif(sys.platform == "darwin", reason="hangs on macos")
5759
def test_tk_loop(kernel):
5860
def do_thing():
5961
time.sleep(1)

ipykernel/tests/test_start_kernel.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
import os
12
from textwrap import dedent
23

4+
import pytest
35
from flaky import flaky
46

57
from .test_embed_kernel import setup_kernel
68

79
TIMEOUT = 15
810

11+
if os.name == "nt":
12+
pytest.skip("skipping tests on windows", allow_module_level=True)
13+
914

1015
@flaky(max_runs=3)
1116
def test_ipython_start_kernel_userns():

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,14 @@ build = "make -C docs html SPHINXOPTS='-W'"
7676
features = ["test"]
7777
[tool.hatch.envs.test.scripts]
7878
test = "python -m pytest -vv {args}"
79-
nowarn = "python -m pytest -vv -W default {args}"
79+
nowarn = "test -W default {args}"
8080

8181
[tool.hatch.envs.cov]
8282
features = ["test"]
83-
dependencies = ["coverage", "pytest-cov"]
84-
[tool.hatch.envs.cov.env-vars]
85-
ARGS = "-vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered"
83+
dependencies = ["coverage", "pytest-cov", "matplotlib", "curio", "trio"]
8684
[tool.hatch.envs.cov.scripts]
87-
test = "python -m pytest $ARGS --cov-fail-under 50 {args}"
85+
test = "python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered {args}"
86+
nowarn = "test -W default {args}"
8887

8988
[tool.mypy]
9089
check_untyped_defs = true

0 commit comments

Comments
 (0)