Skip to content

Commit d207e4c

Browse files
committed
add pre-commit
1 parent af3be06 commit d207e4c

22 files changed

+465
-413
lines changed

Diff for: .github/workflows/ci.yml

+89-89
Original file line numberDiff line numberDiff line change
@@ -53,114 +53,114 @@ jobs:
5353
- os: macos-latest
5454
python-version: "3.8"
5555
steps:
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
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
103103
104104
test_docs:
105105
runs-on: ${{ matrix.os }}
106106
strategy:
107107
fail-fast: false
108108
matrix:
109109
os: [ubuntu-latest]
110-
python-version: [ '3.9' ]
110+
python-version: ["3.9"]
111111
exclude:
112-
- os: windows-latest
113-
python-version: pypy-3.7
112+
- os: windows-latest
113+
python-version: pypy-3.7
114114
steps:
115-
- name: Checkout
116-
uses: actions/checkout@v2
115+
- name: Checkout
116+
uses: actions/checkout@v2
117117

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

121-
- name: Build the docs
122-
run: |
123-
cd docs
124-
pip install -r requirements.txt
125-
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"
126126
127-
- name: Install the Python dependencies
128-
run: |
129-
pip install .
130-
pip install velin
127+
- name: Install the Python dependencies
128+
run: |
129+
pip install .
130+
pip install velin
131131
132-
- name: Check Docstrings
133-
run: |
134-
velin . --check --compact
132+
- name: Check Docstrings
133+
run: |
134+
velin . --check --compact
135135
136136
test_without_debugpy:
137-
runs-on: ${{ matrix.os }}-latest
137+
runs-on: ${{ matrix.os }}
138138
strategy:
139139
fail-fast: false
140140
matrix:
141-
os: [ubuntu]
142-
python-version: [ '3.9' ]
141+
os: [ubuntu-latest]
142+
python-version: ["3.9"]
143143
steps:
144-
- name: Checkout
145-
uses: actions/checkout@v2
146-
147-
- name: Base Setup
148-
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
149-
150-
- name: Install the Python dependencies without debugpy
151-
run: |
152-
pip install .[test]
153-
pip uninstall --yes debugpy
154-
155-
- name: List installed packages
156-
run: |
157-
pip freeze
158-
159-
- name: Run the tests
160-
timeout-minutes: 10
161-
run: |
162-
cmd="python -m pytest -vv -raXxs"
163-
$cmd || $cmd --lf
144+
- name: Checkout
145+
uses: actions/checkout@v2
146+
147+
- name: Base Setup
148+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
149+
150+
- name: Install the Python dependencies without debugpy
151+
run: |
152+
pip install .[test]
153+
pip uninstall --yes debugpy
154+
155+
- name: List installed packages
156+
run: |
157+
pip freeze
158+
159+
- name: Run the tests
160+
timeout-minutes: 10
161+
run: |
162+
cmd="python -m pytest -vv -raXxs"
163+
$cmd || $cmd --lf
164164
165165
test_miniumum_versions:
166166
name: Test Minimum Versions

Diff for: .github/workflows/downstream.yml

+1-1
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

Diff for: .mailmap

+1-1
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

Diff for: .pre-commit-config.yaml

+60
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)