Skip to content

Commit

Permalink
add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Mar 27, 2022
1 parent af3be06 commit d207e4c
Show file tree
Hide file tree
Showing 22 changed files with 465 additions and 413 deletions.
178 changes: 89 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,114 +53,114 @@ jobs:
- os: macos-latest
python-version: "3.8"
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Install the Python dependencies
run: |
pip install .[test] codecov
- name: Install matplotlib
if: ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
run: |
pip install matplotlib || echo 'failed to install matplotlib'
- name: Install alternate event loops
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
pip install curio || echo 'ignoring curio install failure'
pip install trio || echo 'ignoring trio install failure'
- name: List installed packages
run: |
pip uninstall pipx -y
pip install pipdeptree
pipdeptree
pipdeptree --reverse
pip freeze
pip check
- name: Run the tests
timeout-minutes: 15
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
run: |
cmd="python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered"
$cmd || $cmd --lf
- name: Run the tests on pypy and windows
timeout-minutes: 15
if: ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
run: |
cmd="python -m pytest -vv"
$cmd || $cmd --lf
- name: Coverage
run: |
codecov
- name: Checkout
uses: actions/checkout@v2

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

- name: Install the Python dependencies
run: |
pip install .[test] codecov
- name: Install matplotlib
if: ${{ !startsWith(matrix.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
run: |
pip install matplotlib || echo 'failed to install matplotlib'
- name: Install alternate event loops
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
pip install curio || echo 'ignoring curio install failure'
pip install trio || echo 'ignoring trio install failure'
- name: List installed packages
run: |
pip uninstall pipx -y
pip install pipdeptree
pipdeptree
pipdeptree --reverse
pip freeze
pip check
- name: Run the tests
timeout-minutes: 15
if: ${{ !startsWith( matrix.python-version, 'pypy' ) && !startsWith(matrix.os, 'windows') }}
run: |
cmd="python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered"
$cmd || $cmd --lf
- name: Run the tests on pypy and windows
timeout-minutes: 15
if: ${{ startsWith( matrix.python-version, 'pypy' ) || startsWith(matrix.os, 'windows') }}
run: |
cmd="python -m pytest -vv"
$cmd || $cmd --lf
- name: Coverage
run: |
codecov
test_docs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [ '3.9' ]
python-version: ["3.9"]
exclude:
- os: windows-latest
python-version: pypy-3.7
- os: windows-latest
python-version: pypy-3.7
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

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

- name: Build the docs
run: |
cd docs
pip install -r requirements.txt
make html SPHINXOPTS="-W"
- name: Build the docs
run: |
cd docs
pip install -r requirements.txt
make html SPHINXOPTS="-W"
- name: Install the Python dependencies
run: |
pip install .
pip install velin
- name: Install the Python dependencies
run: |
pip install .
pip install velin
- name: Check Docstrings
run: |
velin . --check --compact
- name: Check Docstrings
run: |
velin . --check --compact
test_without_debugpy:
runs-on: ${{ matrix.os }}-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu]
python-version: [ '3.9' ]
os: [ubuntu-latest]
python-version: ["3.9"]
steps:
- name: Checkout
uses: actions/checkout@v2

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

- name: Install the Python dependencies without debugpy
run: |
pip install .[test]
pip uninstall --yes debugpy
- name: List installed packages
run: |
pip freeze
- name: Run the tests
timeout-minutes: 10
run: |
cmd="python -m pytest -vv -raXxs"
$cmd || $cmd --lf
- name: Checkout
uses: actions/checkout@v2

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

- name: Install the Python dependencies without debugpy
run: |
pip install .[test]
pip uninstall --yes debugpy
- name: List installed packages
run: |
pip freeze
- name: Run the tests
timeout-minutes: 10
run: |
cmd="python -m pytest -vv -raXxs"
$cmd || $cmd --lf
test_miniumum_versions:
name: Test Minimum Versions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
with:
package_name: ipyparallel
package_spec: "-e \".[test]\""
package_spec: '-e ".[test]"'

jupyter_kernel_test:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ David Hirschfeld <[email protected]> dhirschfeld <david.hirschfeld
David P. Sanders <[email protected]> David P. Sanders <[email protected]>
David Warde-Farley <[email protected]> David Warde-Farley <>
Doug Blank <[email protected]> Doug Blank <[email protected]>
Eugene Van den Bulke <[email protected]> Eugene Van den Bulke <[email protected]>
Eugene Van den Bulke <[email protected]> Eugene Van den Bulke <[email protected]>
Evan Patterson <[email protected]> <[email protected]>
Evan Patterson <[email protected]> <[email protected]>
Evan Patterson <[email protected]> <[email protected]>
Expand Down
60 changes: 60 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: end-of-file-fixer
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
exclude: ipykernel/kernelapp.py
- id: forbid-new-submodules
- id: check-builtin-literals
- id: trailing-whitespace

# - repo: https://github.com/psf/black
# rev: 22.1.0
# hooks:
# - id: black
# args: ["--line-length", "100"]

# - repo: https://github.com/PyCQA/isort
# rev: 5.10.1
# hooks:
# - id: isort
# files: \.py$
# args: [--profile=black]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier

# - repo: https://github.com/pycqa/flake8
# rev: 4.0.1
# hooks:
# - id: flake8
# additional_dependencies:
# [
# "flake8-bugbear==20.1.4",
# "flake8-logging-format==0.6.0",
# "flake8-implicit-str-concat==0.2.0",
# ]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.8.0
hooks:
- id: eslint

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.10.2
hooks:
- id: check-jsonschema
name: "Check GitHub Workflows"
files: ^\.github/workflows/
types: [yaml]
args: ["--schemafile", "https://json.schemastore.org/github-workflow"]
Loading

0 comments on commit d207e4c

Please sign in to comment.