From 2fdff3ab02db795b62ae0b4e1347b0a44e260092 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 25 Oct 2025 23:09:55 -0400 Subject: [PATCH] =?UTF-8?q?Declare=20dev=20dependencies=20using=20PEP=2073?= =?UTF-8?q?5=20=E2=80=93=20Dependency=20Groups=20in=20pyproject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 13 +++++++------ pyproject.toml | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3a4a9ab9b..f1fcca1ade 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -149,20 +149,21 @@ jobs: - uses: actions/setup-python@v6 with: # This job only needs to target the oldest supported version - python-version: "3.8" + python-version: "3.9" cache: pip cache-dependency-path: .github/workflows/main.yml - - run: pip install clang-format==18.1.* pycln + - run: pip install --group=checkers + # !cancelled(): Show issues even if the previous steps failed. But still fail the job - run: pycln . --config=pycln.toml --check + - name: Run Ruff linter uses: astral-sh/ruff-action@v3 - with: - version: "0.11.0" if: ${{ !cancelled() }} - name: Run Ruff formatter run: ruff format --check if: ${{ !cancelled() }} + # Too many files to fit in a single command, also exclude vendored Scintilla and MAPIStubLibrary - run: | clang-format --Werror --dry-run $(git ls-files '*.cpp' ':!:com/win32comext/mapi/src/MAPIStubLibrary/') @@ -189,13 +190,13 @@ jobs: cache-dependency-path: .github/workflows/main.yml check-latest: true allow-prereleases: true - - run: pip install types-setuptools PyOpenGL mypy==1.16.* + - run: pip install --group=type-checkers - run: mypy . --python-version=${{ matrix.python-version }} - uses: jakebailey/pyright-action@v2 with: python-version: ${{ matrix.python-version }} - version: "1.1.401" + version: PATH annotate: errors if: ${{ !cancelled() }} # Show issues even if the previous steps failed. But still fail the job diff --git a/pyproject.toml b/pyproject.toml index ad9c1daed2..9067c675ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,3 +6,21 @@ requires = [ "setuptools <76.1; python_version <'3.9'", ] build-backend = "setuptools.build_meta" + +[dependency-groups] +checkers = [ # Keep these in sync with .pre-commit-config.yaml + "clang-format ==18.1.8", + "pycln ==2.4.0", + "ruff ==0.11.0", +] +type-checkers = [ + "types-setuptools", + "PyOpenGL", + "mypy ==1.16.*; python_version >='3.9'", + "pyright ==1.1.401", +] +dev = [ + "pre-commit", + { include-group = "checkers" }, + { include-group = "type-checkers" }, +]