Skip to content

Commit 36dcd76

Browse files
authored
CI Cleanup (#61)
1 parent 068124e commit 36dcd76

File tree

8 files changed

+90
-73
lines changed

8 files changed

+90
-73
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ on:
77
schedule:
88
- cron: "0 8 * * *"
99

10+
defaults:
11+
run:
12+
shell: bash -eux {0}
13+
1014
jobs:
11-
pre-commit:
15+
pre_commit:
1216
runs-on: ubuntu-latest
1317
steps:
1418
- uses: actions/checkout@v3
@@ -22,77 +26,65 @@ jobs:
2226
fail-fast: false
2327
matrix:
2428
os: [ubuntu-latest, windows-latest, macos-latest]
25-
python-version: ["3.7", "3.10"]
29+
python-version: ["3.8", "3.11"]
2630
include:
2731
- os: windows-latest
2832
python-version: "3.9"
2933
- os: ubuntu-latest
3034
python-version: "pypy-3.8"
31-
- os: ubuntu-latest
32-
python-version: "3.11-dev"
3335
- os: macos-latest
34-
python-version: "3.8"
36+
python-version: "3.10"
3537
steps:
3638
- name: Checkout
3739
uses: actions/checkout@v3
3840
- name: Base Setup
3941
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
40-
- name: Install the Python dependencies
41-
run: |
42-
pip install -e ".[test]"
43-
- name: List installed packages
44-
run: |
45-
pip freeze
46-
pip check
47-
- name: Run the tests with Coverage
48-
if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(runner.os, 'Windows') }}
49-
run: |
50-
pytest -vv --cov jupyter_server_terminals --cov-branch --cov-report term-missing:skip-covered || pytest -vv --lf
51-
- name: Run the tests on pypy and Windows
52-
if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(runner.os, 'Windows') }}
42+
- name: Run the tests
5343
run: |
54-
pytest -vv || pytest -vv --lf
44+
hatch run cov:test --cov-fail-under 75 || hatch run test:test --lf
5545
- name: Coverage
56-
if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(runner.os, 'Windows') }}
5746
run: |
5847
pip install codecov
5948
codecov
6049
50+
test_docs:
51+
name: Test Docs
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
56+
- run: hatch run docs:build
57+
6158
test_minimum_versions:
6259
name: Test Minimum Versions
6360
timeout-minutes: 20
6461
runs-on: ubuntu-latest
6562
steps:
6663
- uses: actions/checkout@v3
67-
- name: Base Setup
68-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
64+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
6965
with:
70-
python_version: "3.7"
71-
- name: Install miniumum versions
72-
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
66+
python_version: "3.8"
67+
- uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
68+
with:
69+
only_create_file: 1
7370
- name: Run the unit tests
7471
run: |
75-
pytest -vv -W default || pytest -vv -W default --lf
72+
export PIP_CONSTRAINT="./contraints_file.txt"
73+
hatch run test:nowarn || hatch run test:nowarn --lf
7674
7775
test_prereleases:
7876
name: Test Prereleases
7977
runs-on: ubuntu-latest
8078
timeout-minutes: 20
8179
steps:
82-
- name: Checkout
83-
uses: actions/checkout@v3
84-
- name: Base Setup
85-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
86-
- name: Install the Python dependencies
87-
run: |
88-
pip install --pre -e ".[test]"
89-
- name: List installed packages
90-
run: |
91-
pip freeze
92-
pip check
80+
- uses: actions/checkout@v3
81+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
82+
with:
83+
python_version: "3.11"
9384
- name: Run the tests
9485
run: |
95-
pytest -vv -W default || pytest -vv -W default --lf
86+
export PIP_PRE=1
87+
hatch run test:nowarn || hatch run test:nowarn --lf
9688
9789
make_sdist:
9890
name: Make SDist
@@ -136,3 +128,21 @@ jobs:
136128
- uses: actions/checkout@v3
137129
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
138130
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
131+
132+
tests_check: # This job does nothing and is only used for the branch protection
133+
if: always()
134+
needs:
135+
- test
136+
- pre_commit
137+
- test_docs
138+
- test_minimum_versions
139+
- test_prereleases
140+
- check_links
141+
- check_release
142+
- test_sdist
143+
runs-on: ubuntu-latest
144+
steps:
145+
- name: Decide whether the needed jobs succeeded or failed
146+
uses: re-actors/alls-green@release/v1
147+
with:
148+
jobs: ${{ toJSON(needs) }}

.pre-commit-config.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343
rev: v3.2.2
4444
hooks:
4545
- id: pyupgrade
46-
args: [--py37-plus]
46+
args: [--py38-plus]
4747

4848
- repo: https://github.com/PyCQA/doc8
4949
rev: v1.0.0
@@ -70,12 +70,7 @@ repos:
7070
additional_dependencies: [tornado, pytest, traitlets, jupyter_server, terminado]
7171
stages: [manual]
7272

73-
- repo: https://github.com/sirosen/check-jsonschema
73+
- repo: https://github.com/python-jsonschema/check-jsonschema
7474
rev: 0.19.1
7575
hooks:
76-
- id: check-jsonschema
77-
name: "Check GitHub Workflows"
78-
files: ^\.github/workflows/
79-
types: [yaml]
80-
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
81-
stages: [manual]
76+
- id: check-github-workflows

.readthedocs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2
22
sphinx:
33
configuration: docs/source/conf.py
4-
conda:
5-
environment: docs/environment.yml
64
python:
75
version: 3.8
86
install:
97
# install itself with pip install .
108
- method: pip
119
path: .
10+
extra_requirements:
11+
- docs

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ coverage:
33
project:
44
default:
55
target: auto
6-
threshold: 10
6+
threshold: 1
77
patch:
88
default:
99
target: 0%

docs/doc-requirements.txt

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

docs/environment.yml

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

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
#
109109
# This is also used if you do content translation via gettext catalogs.
110110
# Usually you set "language" from the command line for these cases.
111-
language = None
111+
language = "en"
112112

113113
# There are two options for replacing |today|: either, you set today to some
114114
# non-false value, then it is used:

pyproject.toml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers = [
2020
"Programming Language :: Python :: 3.9",
2121
"Programming Language :: Python :: 3.10"
2222
]
23-
requires-python = ">=3.7"
23+
requires-python = ">=3.8"
2424
dependencies = [
2525
"pywinpty>=2.0.3;os_name=='nt'",
2626
"terminado>=0.8.3",
@@ -36,19 +36,51 @@ Homepage = "https://jupyter.org"
3636
[project.optional-dependencies]
3737
test = [
3838
"coverage",
39-
"jupyter_server[test]>=2.0.0rc0",
39+
"jupyter_server[test]>=2.0.0rc3",
4040
"pytest>=7.0",
4141
"pytest_tornasync",
4242
"pytest-cov",
4343
"pytest-timeout",
4444
]
45+
docs = [
46+
"jinja2",
47+
"jupyter_server",
48+
"mistune<2.0", # https://github.com/jupyter/nbconvert/issues/1685"
49+
"myst-parser",
50+
"nbformat",
51+
"packaging",
52+
"tornado",
53+
"pydata_sphinx_theme",
54+
"sphinxcontrib-openapi",
55+
"sphinxcontrib_github_alt",
56+
"sphinxemoji",
57+
]
4558

4659
[tool.hatch.version]
4760
path = "jupyter_server_terminals/_version.py"
4861

4962
[tool.hatch.build.targets.wheel.shared-data]
5063
"jupyter-config" = "etc/jupyter/jupyter_server_config.d"
5164

65+
66+
[tool.hatch.envs.docs]
67+
features = ["docs"]
68+
[tool.hatch.envs.docs.scripts]
69+
build = "make -C docs html SPHINXOPTS='-W'"
70+
71+
[tool.hatch.envs.test]
72+
features = ["test"]
73+
[tool.hatch.envs.test.scripts]
74+
test = "python -m pytest -vv {args}"
75+
nowarn = "test -W default {args}"
76+
77+
[tool.hatch.envs.cov]
78+
features = ["test"]
79+
dependencies = ["coverage", "pytest-cov"]
80+
[tool.hatch.envs.cov.scripts]
81+
test = "python -m pytest -vv --cov jupyter_server_terminals --cov-branch --cov-report term-missing:skip-covered {args}"
82+
nowarn = "test -W default {args}"
83+
5284
[tool.pytest.ini_options]
5385
addopts = "-raXs --durations 10 --color=yes --doctest-modules"
5486
testpaths = [
@@ -59,11 +91,8 @@ timeout = 300
5991
# timeout_method = "thread"
6092
filterwarnings = [
6193
"error",
62-
# From tornado
94+
# from tornado
6395
"ignore:unclosed <socket.socket:ResourceWarning",
64-
"module:make_current is deprecated:DeprecationWarning",
65-
"module:clear_current is deprecated:DeprecationWarning",
66-
"module:There is no current event loop:DeprecationWarning",
6796
# From juypter core
6897
"module:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
6998
]

0 commit comments

Comments
 (0)