Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: move black & isort to pre-commit #1596

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ jobs:
run: |
tox -e dist-check

- name: Codestyle
if: ${{ matrix.python-version == '3.9' }}
run: |
tox -e codestyle

- name: Lint - sort
if: ${{ matrix.python-version == '3.9' }}
run: |
tox -e sort

- name: Security
if: ${{ matrix.python-version == '3.9' }}
run: |
Expand All @@ -64,3 +54,12 @@ jobs:
if: ${{ matrix.python-version == '3.9' }}
run: |
tox -e docs

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: pre-commit/[email protected]
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "^docs/.*$"
default_stages: [commit]

ci:
autofix_commit_msg: "chore(pre-commit.ci): auto fixes"
autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate"

repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fixes:
- chore: bump jinja to 3.1.3 (#1684)
- chore: bump actions/setup-python version (#1686)
- chore: bump actions/checkout version (#1696)
- chore: add pre-commit for isort / black (#1596)

v6.2.0 (2024-01-01)
-------------------
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def read(fname, encoding="ascii"):


if __name__ == "__main__":

VERSION = read_version()

args = set(sys.argv)
Expand Down