Skip to content

Remove dead [tool.sqla_testing] from pyproject.toml (setup.cfg cannot migrate) #737

Description

@laughingman7743

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

  • Remove the never-read [tool.sqla_testing] block from pyproject.toml (lines 129-131) — no behavioral change.
  • Add a comment at the top of setup.cfg explaining it exists solely for SQLAlchemy's compliance test plugin (sqlalchemy.testing.plugin.plugin_base.read_config) and cannot move to pyproject.toml until upstream SQLAlchemy supports it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions