Skip to content

Commit e1a2ea0

Browse files
committed
ci cleanup
1 parent beba237 commit e1a2ea0

File tree

8 files changed

+110
-99
lines changed

8 files changed

+110
-99
lines changed

.github/workflows/build.yml

Lines changed: 61 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,46 +40,63 @@ jobs:
4040
- name: Base Setup
4141
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
4242
with:
43-
python_version: "3.11"
43+
python_version: "3.12"
4444

45-
- name: Install the package
45+
- name: Test the package
4646
run: |
47-
python -m pip install ".[dev,test]"
48-
jlpm run build:test
47+
hatch run cov:test
4948
50-
- name: Unit tests
49+
- name: JavaScript tests
5150
run: |
51+
pip install jupyterlab
52+
jlpm run build:test
5253
jlpm run test
53-
pytest -vv || pytest -vv --lf
5454
5555
- name: Integration Tests
5656
run: |
57+
pip install .
58+
cd
5759
jupyter labextension list 2>&1 | grep -ie "@jupyter-notebook/lab-extension.*enabled.*ok" -
5860
jupyter server extension list 2>&1 | grep -ie "notebook.*enabled" -
5961
python -m jupyterlab.browser_check
6062
61-
test_prerelease:
63+
test_docs:
64+
name: Test Docs
6265
runs-on: ubuntu-latest
63-
timeout-minutes: 10
6466
steps:
65-
- name: Checkout
66-
uses: actions/checkout@v3
67-
68-
- name: Base Setup
69-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
70-
with:
71-
python_version: "3.10"
67+
- uses: actions/checkout@v3
68+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
69+
- run: hatch run docs:build
7270

73-
- name: Install the Python dependencies
74-
run: |
75-
pip install --no-deps .
76-
pip install --pre --upgrade ".[dev,test]"
77-
python -m pip install ".[dev,test]"
78-
jlpm run build:test
71+
test_minimum_versions:
72+
name: Test Minimum Versions
73+
timeout-minutes: 20
74+
runs-on: ubuntu-latest
75+
steps:
76+
- uses: actions/checkout@v3
77+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
78+
with:
79+
python_version: "3.8"
80+
- uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
81+
with:
82+
only_create_file: 1
83+
- name: Run the unit tests
84+
run: |
85+
export PIP_CONSTRAINT="./contraints_file.txt"
86+
hatch run test:nowarn || hatch run test:nowarn --lf
7987
80-
- name: Python Unit tests
81-
run: |
82-
pytest -vv || pytest -vv --lf
88+
test_prereleases:
89+
name: Test Prereleases
90+
runs-on: ubuntu-latest
91+
timeout-minutes: 20
92+
steps:
93+
- uses: actions/checkout@v3
94+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
95+
with:
96+
python_version: "3.11"
97+
- name: Run the tests
98+
run: |
99+
PIP_PRE=1 hatch run test:nowarn || hatch run test:nowarn --lf
83100
84101
install:
85102
needs: [build]
@@ -131,7 +148,7 @@ jobs:
131148
jupyter notebook --version
132149
jupyter notebook --help
133150
134-
link_check:
151+
check_linkts:
135152
runs-on: ubuntu-latest
136153
timeout-minutes: 10
137154
steps:
@@ -149,3 +166,22 @@ jobs:
149166
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
150167
- run: pip install -e .
151168
- uses: jupyterlab/maintainer-tools/.github/actions/pre-commit@v1
169+
170+
171+
python_tests_check: # This job does nothing and is only used for the branch protection
172+
if: always()
173+
needs:
174+
- test
175+
- install
176+
- pre_commit
177+
- test_docs
178+
- test_minimum_versions
179+
- test_prereleases
180+
- check_links
181+
- test_sdist
182+
runs-on: ubuntu-latest
183+
steps:
184+
- name: Decide whether the needed jobs succeeded or failed
185+
uses: re-actors/alls-green@release/v1
186+
with:
187+
jobs: ${{ toJSON(needs) }}

.github/workflows/docs.yml

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

.pre-commit-config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,10 @@ repos:
5656
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
5757
stages: [manual]
5858

59-
- repo: https://github.com/sirosen/check-jsonschema
59+
- repo: https://github.com/python-jsonschema/check-jsonschema
6060
rev: 0.19.1
6161
hooks:
62-
- id: check-jsonschema
63-
name: 'Check GitHub Workflows'
64-
files: ^\.github/workflows/
65-
types: [yaml]
66-
args: ['--schemafile', 'https://json.schemastore.org/github-workflow']
67-
stages: [manual]
62+
- id: check-github-workflows
6863

6964
- repo: local
7065
hooks:

.readthedocs.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
conda:
2-
file: docs/environment.yml
1+
version: 2
2+
sphinx:
3+
configuration: docs/source/conf.py
34
python:
4-
version: 3
5+
version: 3.8
6+
install:
7+
# install notebook itself
8+
- method: pip
9+
path: ".[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 & 5 deletions
This file was deleted.

docs/environment.yml

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

pyproject.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ test = [
6060
"ipykernel",
6161
"jupyterlab_server[test]>=2.13,<3",
6262
]
63+
docs = [
64+
"myst_parser",
65+
"nbsphinx",
66+
"pydata-sphinx-theme",
67+
"sphinx>=1.3.6",
68+
"sphinxcontrib_github_alt",
69+
]
6370
dev = [
6471
"pre-commit",
6572
"hatch"
@@ -98,6 +105,23 @@ artifacts = [
98105
]
99106
include = ["/notebook"]
100107

108+
[tool.hatch.envs.docs]
109+
features = ["docs"]
110+
[tool.hatch.envs.docs.scripts]
111+
build = "make -C docs html SPHINXOPTS='-W'"
112+
113+
[tool.hatch.envs.test]
114+
features = ["test"]
115+
[tool.hatch.envs.test.scripts]
116+
test = "python -m pytest -vv {args}"
117+
nowarn = "test -W default {args}"
118+
119+
[tool.hatch.envs.cov]
120+
features = ["test"]
121+
dependencies = ["coverage", "pytest-cov"]
122+
[tool.hatch.envs.cov.scripts]
123+
test = "python -m pytest -vv --cov notebook --cov-branch --cov-report term-missing:skip-covered {args}"
124+
nowarn = "test -W default {args}"
101125

102126
[tool.hatch.build.hooks.jupyter-builder]
103127
dependencies = ["hatch-jupyter-builder>=0.2"]
@@ -128,6 +152,20 @@ filterwarnings = [
128152
"ignore:clear_current is deprecated"
129153
]
130154

155+
[tool.coverage.report]
156+
exclude_lines = [
157+
"pragma: no cover",
158+
"def __repr__",
159+
"if self.debug:",
160+
"if settings.DEBUG",
161+
"raise AssertionError",
162+
"raise NotImplementedError",
163+
"if 0:",
164+
"if __name__ == .__main__.:",
165+
"class .*\bProtocol\\):",
166+
"@(abc\\.)?abstractmethod",
167+
]
168+
131169
[tool.flake8]
132170
ignore = "E501, W503, E402"
133171
builtins = "c, get_config"

0 commit comments

Comments
 (0)