From 3743bf1b0d7f3ea77919288fa1aac841c354789f Mon Sep 17 00:00:00 2001 From: Steffen Allner Date: Fri, 22 Sep 2023 09:32:25 +0200 Subject: [PATCH] Move slow linters back to `tox -e lint`. Those checkers are not able to work on single files present in a commit but need conecptionally work on the whole repository (check-manifest) and thus are not suited to be run before each commit, but only in the CI. --- .github/workflows/tests.yml | 3 +++ .pre-commit-config.yaml | 8 -------- tox.ini | 11 +++++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 307c33fc23..dffa2b81f2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,7 @@ jobs: - ["macos", "macos-11"] config: # [Python version, tox env] + - ["3.9", "lint"] - ["3.7", "py37"] - ["3.8", "py38"] - ["3.9", "py39"] @@ -31,8 +32,10 @@ jobs: - ["3.9", "docs"] - ["3.9", "coverage"] exclude: + - { os: ["windows", "windows-latest"], config: ["3.9", "lint"] } - { os: ["windows", "windows-latest"], config: ["3.9", "docs"] } - { os: ["windows", "windows-latest"], config: ["3.9", "coverage"] } + - { os: ["macos", "macos-11"], config: ["3.9", "lint"] } - { os: ["macos", "macos-11"], config: ["3.9", "docs"] } - { os: ["macos", "macos-11"], config: ["3.9", "coverage"] } # macOS/Python 3.11+ is set up for universal2 architecture diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fe1349bf5..6c99aac659 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,11 +32,3 @@ repos: hooks: - id: teyit exclude: src/App/tests/fixtures/error.py # invalid syntax - - repo: https://github.com/mgedmin/check-manifest - rev: "0.49" - hooks: - - id: check-manifest - - repo: https://github.com/mgedmin/check-python-versions - rev: "0.21.3" - hooks: - - id: check-python-versions diff --git a/tox.ini b/tox.ini index 98eeac6bd1..6491464a88 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,7 @@ [tox] minversion = 3.18 envlist = + lint py37 py38 py39 @@ -30,6 +31,16 @@ commands = {envdir}/bin/alltests --layer '!Products.PluginIndexes' {posargs:-vc} allowlist_externals = * +[testenv:lint] +basepython = python3 +commands_pre = +commands = + check-manifest + check-python-versions +deps = + check-manifest + check-python-versions + [testenv:pre-commit] basepython = python3 description = This env runs all linters configured in .pre-commit-config.yaml