MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_pep8

Function test_pep8

noxfile.py:367–404  ·  view source on GitHub ↗

Run linting and formatting checks.

(session: nox.Session)

Source from the content-addressed store, hash-verified

365
366@nox.session(name="pep8")
367def test_pep8(session: nox.Session) -> None:
368 """Run linting and formatting checks."""
369
370 for pattern in ["*.so", "*.pyd", "*.dylib"]:
371 for filepath in Path("lib/sqlalchemy").rglob(pattern):
372 filepath.unlink()
373
374 session.install("-e", ".")
375
376 session.install(*nox.project.dependency_groups(pyproject, "lint"))
377
378 failed = []
379
380 for cmd in [
381 "flake8p ./lib/ ./test/ ./examples/ noxfile.py "
382 "setup.py doc/build/conf.py",
383 # run "unused argument" lints on asyncio, as we have a lot of
384 # proxy methods here
385 "flake8p --ignore='' --select='U100,U101' "
386 "./lib/sqlalchemy/ext/asyncio "
387 "./lib/sqlalchemy/orm/scoping.py",
388 "black --check ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py",
389 "slotscheck -m sqlalchemy",
390 "python ./tools/format_docs_code.py --check",
391 "python ./tools/generate_tuple_map_overloads.py --check",
392 "python ./tools/generate_proxy_methods.py --check",
393 "python ./tools/sync_test_files.py --check",
394 "python ./tools/generate_sql_functions.py --check",
395 "python ./tools/normalize_file_headers.py --check",
396 "python ./tools/walk_packages.py",
397 ]:
398 try:
399 session.run(*cmd.split())
400 except CommandFailed as err:
401 failed.append((cmd, err))
402
403 if failed:
404 session.error(f"failed with {len(failed)} errors")

Callers

nothing calls this directly

Calls 4

unlinkMethod · 0.80
errorMethod · 0.80
runMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected