-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #631 from davidbrochart/style
Use pre-commit
- Loading branch information
Showing
61 changed files
with
2,993 additions
and
2,798 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,38 +2,62 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: '*' | ||
branches: "*" | ||
pull_request: | ||
branches: '*' | ||
branches: "*" | ||
|
||
jobs: | ||
# Run "pre-commit run --all-files" | ||
pre-commit: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 2 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
# ref: https://github.com/pre-commit/action | ||
- uses: pre-commit/[email protected] | ||
- name: Help message if pre-commit fail | ||
if: ${{ failure() }} | ||
run: | | ||
echo "You can install pre-commit hooks to automatically run formatting" | ||
echo "on each commit with:" | ||
echo " pre-commit install" | ||
echo "or you can run by hand on staged files with" | ||
echo " pre-commit run" | ||
echo "or after-the-fact on already committed files with" | ||
echo " pre-commit run --all-files" | ||
build-n-test-n-coverage: | ||
name: Build, test and code coverage | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [ 3.6, 3.7, 3.8, 3.9 ] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: '3.9' | ||
OS: ${{ matrix.os }} | ||
PYTHON: "3.9" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade setuptools pip | ||
pip install --upgrade --upgrade-strategy eager -e .[test] pytest-cov codecov 'coverage<5' | ||
pip freeze | ||
- name: Check types | ||
run: mypy jupyter_client/manager.py jupyter_client/multikernelmanager.py jupyter_client/client.py jupyter_client/blocking/client.py jupyter_client/asynchronous/client.py jupyter_client/channels.py jupyter_client/session.py jupyter_client/adapter.py jupyter_client/connect.py jupyter_client/consoleapp.py jupyter_client/jsonutil.py jupyter_client/kernelapp.py jupyter_client/launcher.py | ||
- name: Run the tests | ||
run: py.test --cov jupyter_client -v jupyter_client | ||
- name: Code coverage | ||
run: codecov | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade setuptools pip | ||
pip install --upgrade --upgrade-strategy eager -e .[test] pytest-cov codecov 'coverage<5' | ||
pip freeze | ||
- name: Check types | ||
run: mypy jupyter_client/manager.py jupyter_client/multikernelmanager.py jupyter_client/client.py jupyter_client/blocking/client.py jupyter_client/asynchronous/client.py jupyter_client/channels.py jupyter_client/session.py jupyter_client/adapter.py jupyter_client/connect.py jupyter_client/consoleapp.py jupyter_client/jsonutil.py jupyter_client/kernelapp.py jupyter_client/launcher.py | ||
- name: Run the tests | ||
run: py.test --cov jupyter_client -v jupyter_client | ||
- name: Code coverage | ||
run: codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
repos: | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v1.9.0 | ||
hooks: | ||
- id: reorder-python-imports | ||
- repo: https://github.com/psf/black | ||
rev: 20.8b1 | ||
hooks: | ||
- id: black | ||
args: ["--line-length", "100"] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.2.1 | ||
hooks: | ||
- id: prettier | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: "3.8.4" | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: requirements-txt-fixer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,3 @@ Utility functions | |
----------------- | ||
|
||
.. autofunction:: run_kernel | ||
|
Oops, something went wrong.