diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 370611686..ecc92c8f9 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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: | @@ -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/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..1e9787bca --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CHANGES.rst b/CHANGES.rst index 627517dc8..6a642333d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) ------------------- diff --git a/setup.py b/setup.py index 29b70613e..8c3523784 100755 --- a/setup.py +++ b/setup.py @@ -67,7 +67,6 @@ def read(fname, encoding="ascii"): if __name__ == "__main__": - VERSION = read_version() args = set(sys.argv)