From 24f0680a3c5d2d3c1d762272eab5064ba1118a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Tue, 4 Nov 2025 03:20:23 +0300 Subject: [PATCH 1/3] Move flake8 to pre-commit --- .github/workflows/ci.yml | 17 ----------------- .pre-commit-config.yaml | 5 +++++ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f6f3a5..dac74be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,20 +54,3 @@ jobs: # - name: Upload coverage to coveralls # run: | # coveralls - - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install tox and flake8 packages - run: pip install tox tox-gh-actions flake8 - - - name: Lint - run: tox -e flake8 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f14e733..f43a7f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,3 +4,8 @@ repos: hooks: - id: pyupgrade args: ["--py39-plus"] + +- repo: https://github.com/pycqa/flake8 + rev: 7.3.0 + hooks: + - id: flake8 From fa666043cd142d27959b6e1e1bb0ed8dbceb9883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Tue, 4 Nov 2025 03:23:58 +0300 Subject: [PATCH 2/3] Apply flake8 fixes --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ce077a4..4b85f0c 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import io import os import re import sys @@ -42,7 +41,7 @@ def read(fname, fail_silently=False): filepath = os.path.join(os.path.dirname(__file__), fname) with open(filepath, encoding="utf8") as f: return f.read() - except: + except Exception: if not fail_silently: raise return "" @@ -66,7 +65,7 @@ def extra_requirements(cls, glob_pattern): pattern = os.path.join(os.path.dirname(__file__), glob_pattern) requirements = {} for path in glob.glob(pattern): - name = path[len(before) : -len(after)] + name = path[len(before): -len(after)] requirements[name] = cls.requirements(path) return requirements From 09a3670a9685a07ae69a434157c313d04eb538dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Tue, 4 Nov 2025 03:25:32 +0300 Subject: [PATCH 3/3] Check pre-commit hooks in CI --- .github/workflows/prek.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/prek.yml diff --git a/.github/workflows/prek.yml b/.github/workflows/prek.yml new file mode 100644 index 0000000..be7d6d9 --- /dev/null +++ b/.github/workflows/prek.yml @@ -0,0 +1,10 @@ +name: Check pre-commit hooks + +on: [push, pull_request] + +jobs: + prek: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5.0.0 + - uses: j178/prek-action@v1.0.11