Skip to content

Commit 59439b1

Browse files
authored
Merge pull request #889 from blink1073/ci-cleanup
2 parents ed5f5eb + d0cb08d commit 59439b1

25 files changed

+523
-410
lines changed

.github/workflows/ci.yml

Lines changed: 112 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ defaults:
1414
shell: bash
1515

1616
jobs:
17+
# Run "pre-commit run --all-files"
18+
pre-commit:
19+
runs-on: ubuntu-20.04
20+
timeout-minutes: 2
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-python@v2
25+
with:
26+
python-version: 3.8
27+
28+
# ref: https://github.com/pre-commit/action
29+
- uses: pre-commit/[email protected]
30+
- name: Help message if pre-commit fail
31+
if: ${{ failure() }}
32+
run: |
33+
echo "You can install pre-commit hooks to automatically run formatting"
34+
echo "on each commit with:"
35+
echo " pre-commit install"
36+
echo "or you can run by hand on staged files with"
37+
echo " pre-commit run"
38+
echo "or after-the-fact on already committed files with"
39+
echo " pre-commit run --all-files"
40+
1741
build:
1842
runs-on: ${{ matrix.os }}
1943
strategy:
@@ -29,114 +53,114 @@ jobs:
2953
- os: macos-latest
3054
python-version: "3.8"
3155
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v2
34-
35-
- name: Base Setup
36-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
37-
38-
- name: Install the Python dependencies
39-
run: |
40-
pip install .[test] codecov
41-
42-
- name: Install matplotlib
43-
if: ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
44-
run: |
45-
pip install matplotlib || echo 'failed to install matplotlib'
46-
47-
- name: Install alternate event loops
48-
if: ${{ !startsWith(matrix.os, 'windows') }}
49-
run: |
50-
pip install curio || echo 'ignoring curio install failure'
51-
pip install trio || echo 'ignoring trio install failure'
52-
53-
- name: List installed packages
54-
run: |
55-
pip uninstall pipx -y
56-
pip install pipdeptree
57-
pipdeptree
58-
pipdeptree --reverse
59-
pip freeze
60-
pip check
61-
62-
- name: Run the tests
63-
timeout-minutes: 15
64-
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
65-
run: |
66-
cmd="python -m pytest -vv -raXs --cov ipykernel --cov-branch --cov-report term-missing:skip-covered --durations 10 --color=yes"
67-
$cmd || $cmd --lf
68-
69-
- name: Run the tests on pypy and windows
70-
timeout-minutes: 15
71-
if: ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
72-
run: |
73-
cmd="python -m pytest -vv -raXs --durations 10 --color=yes"
74-
$cmd || $cmd --lf
75-
76-
- name: Coverage
77-
run: |
78-
codecov
56+
- name: Checkout
57+
uses: actions/checkout@v2
58+
59+
- name: Base Setup
60+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
61+
62+
- name: Install the Python dependencies
63+
run: |
64+
pip install .[test] codecov
65+
66+
- name: Install matplotlib
67+
if: ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
68+
run: |
69+
pip install matplotlib || echo 'failed to install matplotlib'
70+
71+
- name: Install alternate event loops
72+
if: ${{ !startsWith(matrix.os, 'windows') }}
73+
run: |
74+
pip install curio || echo 'ignoring curio install failure'
75+
pip install trio || echo 'ignoring trio install failure'
76+
77+
- name: List installed packages
78+
run: |
79+
pip uninstall pipx -y
80+
pip install pipdeptree
81+
pipdeptree
82+
pipdeptree --reverse
83+
pip freeze
84+
pip check
85+
86+
- name: Run the tests
87+
timeout-minutes: 15
88+
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
89+
run: |
90+
cmd="python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered"
91+
$cmd || $cmd --lf
92+
93+
- name: Run the tests on pypy and windows
94+
timeout-minutes: 15
95+
if: ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
96+
run: |
97+
cmd="python -m pytest -vv"
98+
$cmd || $cmd --lf
99+
100+
- name: Coverage
101+
run: |
102+
codecov
79103
80104
test_docs:
81105
runs-on: ${{ matrix.os }}
82106
strategy:
83107
fail-fast: false
84108
matrix:
85109
os: [ubuntu-latest]
86-
python-version: [ '3.9' ]
110+
python-version: ["3.9"]
87111
exclude:
88-
- os: windows-latest
89-
python-version: pypy-3.7
112+
- os: windows-latest
113+
python-version: pypy-3.7
90114
steps:
91-
- name: Checkout
92-
uses: actions/checkout@v2
115+
- name: Checkout
116+
uses: actions/checkout@v2
93117

94-
- name: Base Setup
95-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
118+
- name: Base Setup
119+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
96120

97-
- name: Build the docs
98-
run: |
99-
cd docs
100-
pip install -r requirements.txt
101-
make html SPHINXOPTS="-W"
121+
- name: Build the docs
122+
run: |
123+
cd docs
124+
pip install -r requirements.txt
125+
make html SPHINXOPTS="-W"
102126
103-
- name: Install the Python dependencies
104-
run: |
105-
pip install .
106-
pip install velin
127+
- name: Install the Python dependencies
128+
run: |
129+
pip install .
130+
pip install velin
107131
108-
- name: Check Docstrings
109-
run: |
110-
velin . --check --compact
132+
- name: Check Docstrings
133+
run: |
134+
velin . --check --compact
111135
112136
test_without_debugpy:
113-
runs-on: ${{ matrix.os }}-latest
137+
runs-on: ${{ matrix.os }}
114138
strategy:
115139
fail-fast: false
116140
matrix:
117-
os: [ubuntu]
118-
python-version: [ '3.9' ]
141+
os: [ubuntu-latest]
142+
python-version: ["3.9"]
119143
steps:
120-
- name: Checkout
121-
uses: actions/checkout@v2
144+
- name: Checkout
145+
uses: actions/checkout@v2
122146

123-
- name: Base Setup
124-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
147+
- name: Base Setup
148+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
125149

126-
- name: Install the Python dependencies without debugpy
127-
run: |
128-
pip install .[test]
129-
pip uninstall --yes debugpy
150+
- name: Install the Python dependencies without debugpy
151+
run: |
152+
pip install .[test]
153+
pip uninstall --yes debugpy
130154
131-
- name: List installed packages
132-
run: |
133-
pip freeze
155+
- name: List installed packages
156+
run: |
157+
pip freeze
134158
135-
- name: Run the tests
136-
timeout-minutes: 10
137-
run: |
138-
cmd="python -m pytest -vv -raXxs --durations 10 --color=yes"
139-
$cmd || $cmd --lf
159+
- name: Run the tests
160+
timeout-minutes: 10
161+
run: |
162+
cmd="python -m pytest -vv -raXxs"
163+
$cmd || $cmd --lf
140164
141165
test_miniumum_versions:
142166
name: Test Minimum Versions
@@ -152,7 +176,7 @@ jobs:
152176
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
153177
- name: Run the unit tests
154178
run: |
155-
cmd="python -m pytest -vv -raXxs --durations 10 --color=yes"
179+
cmd="python -m pytest -vv -raXxs"
156180
$cmd || $cmd --lf
157181
158182
test_prereleases:
@@ -173,7 +197,7 @@ jobs:
173197
pip check
174198
- name: Run the tests
175199
run: |
176-
cmd="python -m pytest -vv -raXs --durations 10 --color=yes"
200+
cmd="python -m pytest -vv"
177201
$cmd || $cmd --lf
178202
179203
make_sdist:
@@ -214,5 +238,5 @@ jobs:
214238
- name: Run Test
215239
run: |
216240
cd sdist/test
217-
cmd="python -m pytest -vv -raXs --durations 10 --color=yes"
241+
cmd="python -m pytest -vv"
218242
$cmd || $cmd --lf

.github/workflows/downstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
5353
with:
5454
package_name: ipyparallel
55-
package_spec: "-e \".[test]\""
55+
package_spec: '-e ".[test]"'
5656

5757
jupyter_kernel_test:
5858
runs-on: ubuntu-latest

.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ David Hirschfeld <[email protected]> dhirschfeld <david.hirschfeld
2626
David P. Sanders <[email protected]> David P. Sanders <[email protected]>
2727
David Warde-Farley <[email protected]> David Warde-Farley <>
2828
Doug Blank <[email protected]> Doug Blank <[email protected]>
29-
Eugene Van den Bulke <[email protected]> Eugene Van den Bulke <[email protected]>
29+
Eugene Van den Bulke <[email protected]> Eugene Van den Bulke <[email protected]>
3030
3131
3232

.pre-commit-config.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.1.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: check-case-conflict
7+
- id: check-executables-have-shebangs
8+
- id: requirements-txt-fixer
9+
- id: check-added-large-files
10+
- id: check-case-conflict
11+
- id: check-toml
12+
- id: check-yaml
13+
- id: debug-statements
14+
exclude: ipykernel/kernelapp.py
15+
- id: forbid-new-submodules
16+
- id: check-builtin-literals
17+
- id: trailing-whitespace
18+
19+
# - repo: https://github.com/psf/black
20+
# rev: 22.1.0
21+
# hooks:
22+
# - id: black
23+
# args: ["--line-length", "100"]
24+
25+
# - repo: https://github.com/PyCQA/isort
26+
# rev: 5.10.1
27+
# hooks:
28+
# - id: isort
29+
# files: \.py$
30+
# args: [--profile=black]
31+
32+
- repo: https://github.com/pre-commit/mirrors-prettier
33+
rev: v2.5.1
34+
hooks:
35+
- id: prettier
36+
37+
# - repo: https://github.com/pycqa/flake8
38+
# rev: 4.0.1
39+
# hooks:
40+
# - id: flake8
41+
# additional_dependencies:
42+
# [
43+
# "flake8-bugbear==20.1.4",
44+
# "flake8-logging-format==0.6.0",
45+
# "flake8-implicit-str-concat==0.2.0",
46+
# ]
47+
48+
- repo: https://github.com/pre-commit/mirrors-eslint
49+
rev: v8.8.0
50+
hooks:
51+
- id: eslint
52+
53+
- repo: https://github.com/sirosen/check-jsonschema
54+
rev: 0.10.2
55+
hooks:
56+
- id: check-jsonschema
57+
name: "Check GitHub Workflows"
58+
files: ^\.github/workflows/
59+
types: [yaml]
60+
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]

0 commit comments

Comments
 (0)