From: Mike Bayer Date: Sun, 10 May 2026 15:30:00 +0000 (-0400) Subject: collect pep8 errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c650cede44e74b0a1939652034debc9fa74759c;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git collect pep8 errors run each command in a try/except (they print out error messages regardless) and report at the end on all individual runs. Change-Id: I347c04f5c49c69daadf9f5f9e7c6c488cdf27f35 --- diff --git a/noxfile.py b/noxfile.py index 9d59f9b6d2..97cd30e8de 100644 --- a/noxfile.py +++ b/noxfile.py @@ -11,6 +11,7 @@ from typing import List from typing import Set import nox +from nox.command import CommandFailed if sys.version_info > (3, 12): nox.needs_version = ">=2025.10.16" @@ -368,6 +369,8 @@ def test_pep8(session: nox.Session) -> None: session.install(*nox.project.dependency_groups(pyproject, "lint")) + failed = [] + for cmd in [ "flake8p ./lib/ ./test/ ./examples/ noxfile.py " "setup.py doc/build/conf.py", @@ -387,5 +390,10 @@ def test_pep8(session: nox.Session) -> None: "python ./tools/cython_imports.py --check", "python ./tools/walk_packages.py", ]: + try: + session.run(*cmd.split()) + except CommandFailed as err: + failed.append((cmd, err)) - session.run(*cmd.split()) + if failed: + session.error(f"failed with {len(failed)} errors")