Summary
pyproject.toml contains a [tool.sqla_testing] block (lines 129-131) that duplicates setup.cfg, but SQLAlchemy's test plugin never reads it — it is dead configuration and should be removed. Conversely, setup.cfg cannot be migrated to pyproject.toml today, so it must stay.
Investigation
SQLAlchemy's testing plugin hardcodes reading setup.cfg / test.cfg via configparser and has no TOML/pyproject support:
# sqlalchemy/testing/plugin/plugin_base.py (2.0.46; identical on upstream main)
def read_config(root_path):
global file_config
file_config = configparser.ConfigParser()
file_config.read(
[str(root_path / "setup.cfg"), str(root_path / "test.cfg")]
)
requirement_cls is read from file_config.get("sqla_testing", "requirement_cls") (CLI override --requirements exists).
profile_file is read from file_config.get("sqla_testing", "profile_file") and has no CLI override and no default — it can only come from setup.cfg/test.cfg. Deleting setup.cfg breaks just test sqla / sqla-async with configparser.NoSectionError.
- Verified on the installed SQLAlchemy 2.0.46 and on upstream
main — no released or unreleased version reads this config from pyproject.toml.
- Nothing else in the repo (justfile, CI workflows, docs) references
setup.cfg; it exists solely for SQLAlchemy's test plugin.
Action items
Summary
pyproject.tomlcontains a[tool.sqla_testing]block (lines 129-131) that duplicatessetup.cfg, but SQLAlchemy's test plugin never reads it — it is dead configuration and should be removed. Conversely,setup.cfgcannot be migrated topyproject.tomltoday, so it must stay.Investigation
SQLAlchemy's testing plugin hardcodes reading
setup.cfg/test.cfgviaconfigparserand has no TOML/pyproject support:requirement_clsis read fromfile_config.get("sqla_testing", "requirement_cls")(CLI override--requirementsexists).profile_fileis read fromfile_config.get("sqla_testing", "profile_file")and has no CLI override and no default — it can only come fromsetup.cfg/test.cfg. Deletingsetup.cfgbreaksjust test sqla/sqla-asyncwithconfigparser.NoSectionError.main— no released or unreleased version reads this config frompyproject.toml.setup.cfg; it exists solely for SQLAlchemy's test plugin.Action items
[tool.sqla_testing]block frompyproject.toml(lines 129-131) — no behavioral change.setup.cfgexplaining it exists solely for SQLAlchemy's compliance test plugin (sqlalchemy.testing.plugin.plugin_base.read_config) and cannot move topyproject.tomluntil upstream SQLAlchemy supports it.