# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/python/black
- rev: 25.9.0
+ rev: 25.11.0
hooks:
- id: black
rev: 7.3.0
hooks:
- id: flake8
+ entry: python -m flake8p
additional_dependencies:
+ - flake8-pyproject
- flake8-import-order>=0.19.2
- flake8-import-single==0.1.5
- flake8-builtins
session.install(*nox.project.dependency_groups(pyproject, "lint"))
for cmd in [
- "flake8 ./lib/ ./test/ ./examples/ noxfile.py "
+ "flake8p ./lib/ ./test/ ./examples/ noxfile.py "
"setup.py doc/build/conf.py",
- "flake8 --extend-ignore='' ./lib/sqlalchemy/ext/asyncio "
+ # run "unused argument" lints on asyncio, as we have a lot of
+ # proxy methods here
+ "flake8p --ignore='' --select='U100,U101' "
+ "./lib/sqlalchemy/ext/asyncio "
"./lib/sqlalchemy/orm/scoping.py",
"black --check ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py",
"slotscheck -m sqlalchemy",
lint = [
{include-group = "tests-greenlet"},
- "flake8>=7.2.0",
+ "flake8>=7.3.0",
+ "flake8-pyproject",
"flake8-import-order>=0.19.2",
"flake8-import-single==0.1.5",
"flake8-builtins",
"flake8-rst-docstrings",
"pydocstyle<4.0.0",
"pygments",
- "black==25.9.0",
+ "black==25.11.0",
"slotscheck>=0.17.0",
"zimports>=0.6.3", # required by generate_tuple_map_overloads
]
black-line-length = 79
+[tool.flake8]
+show-source = false
+enable-extensions = "G"
+
+# E203 is due to https://github.com/PyCQA/pycodestyle/issues/373
+ignore = [
+ "A003","A005",
+ "D",
+ "E203","E305","E701","E704","E711","E712","E721","E722","E741",
+ "I300",
+ "N801","N802","N806",
+ "RST304","RST303","RST299","RST399",
+ "W503","W504","W601",
+ "U100","U101"
+]
+
+exclude = [".venv",".git",".tox","dist","doc","*egg","build"]
+import-order-style = "google"
+application-import-names = ["sqlalchemy","test"]
+per-file-ignores =[
+ "**/__init__.py:F401",
+ "test/*:FA100",
+ "test/typing/plain_files/*:F821,E501,FA100",
+ "lib/sqlalchemy/events.py:F401",
+ "lib/sqlalchemy/schema.py:F401",
+ "lib/sqlalchemy/types.py:F401",
+ "lib/sqlalchemy/sql/expression.py:F401",
+ "lib/sqlalchemy/util/typing.py:F401"
+]
+
+unused-arguments-ignore-stub-functions=true
+unused-arguments-ignore-dunder=true
+
[tool.slotscheck]
exclude-modules = '''
^sqlalchemy\.testing
-[flake8]
-show-source = false
-enable-extensions = G
-
-# E203 is due to https://github.com/PyCQA/pycodestyle/issues/373
-ignore =
- A003,A005
- D,
- E203,E305,E701,E704,E711,E712,E721,E722,E741,
- I300,
- N801,N802,N806,
- RST304,RST303,RST299,RST399,
- W503,W504,W601
-extend-ignore =
- # keep in extend ignore so that they can be enabled in a subset of files in the tox run
- U100,U101
-exclude = .venv,.git,.tox,dist,doc,*egg,build
-import-order-style = google
-application-import-names = sqlalchemy,test
-per-file-ignores =
- **/__init__.py:F401
- test/*:FA100
- test/typing/plain_files/*:F821,E501,FA100
- lib/sqlalchemy/events.py:F401
- lib/sqlalchemy/schema.py:F401
- lib/sqlalchemy/types.py:F401
- lib/sqlalchemy/sql/expression.py:F401
- lib/sqlalchemy/util/typing.py:F401
-
-unused-arguments-ignore-stub-functions=true
-unused-arguments-ignore-dunder=true
[sqla_testing]
requirement_cls = test.requirements:DefaultRequirements
{[greenletextras]extras}
deps=
+ flake8-pyproject
flake8>=7.3.0
flake8-import-order>=0.19.2
flake8-builtins
# in case it requires a version pin
pydocstyle
pygments
- black==25.9.0
+ black==25.11.0
slotscheck>=0.17.0
# required by generate_tuple_map_overloads
git
sh
commands =
- flake8 ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py {posargs}
- # run flake8-unused-arguments only on some files / modules
- flake8 --extend-ignore='' ./lib/sqlalchemy/ext/asyncio ./lib/sqlalchemy/orm/scoping.py
+ flake8p ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py {posargs}
+
+ # run "unused argument" lints on asyncio, as we have a lot of
+ # proxy methods here
+ flake8p --ignore='' --select='U100,U101' ./lib/sqlalchemy/ext/asyncio ./lib/sqlalchemy/orm/scoping.py
+
black --check ./lib/ ./test/ ./examples/ setup.py doc/build/conf.py
slotscheck -m sqlalchemy
python ./tools/format_docs_code.py --check