From 83d38b64afa7036665450b0a768d6ea9b21d8327 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 2 Sep 2022 16:18:17 +0200 Subject: [PATCH 1/4] ci: move black & isort to pre-commit --- .github/workflows/python-package.yml | 19 +++++++++---------- .pre-commit-config.yaml | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 .pre-commit-config.yaml 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..ca5d8dfe0 --- /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.10.1 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 22.6.0 + hooks: + - id: black From 1d7036916ebd65f49f03debab2e5d621656a24ff Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 7 Sep 2023 00:36:46 -0500 Subject: [PATCH 2/4] docs: add detail to CHANGES --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) 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) ------------------- From 1f798c681f1baac0dec00d70fca16e7e6fc63ca3 Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 7 Sep 2023 09:28:35 -0500 Subject: [PATCH 3/4] chore: update versions to latest --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca5d8dfe0..1e9787bca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,10 +9,10 @@ ci: repos: - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 23.7.0 hooks: - id: black From 0f7cde00c93bfcc20dca43ed7358aec9f90aa74a Mon Sep 17 00:00:00 2001 From: Sijis Aviles Date: Thu, 7 Sep 2023 09:34:02 -0500 Subject: [PATCH 4/4] style: run black --- setup.py | 1 - 1 file changed, 1 deletion(-) 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)