Visitar URL original
[sqlalchemy-spanner] Make alembic an optional extra dependency · Issue #18584 · googleapis/google-cloud-python · GitHub
Skip to content

[sqlalchemy-spanner] Make alembic an optional extra dependency #18584

Description

@chalmerlowe

Feature / Enhancement Description

Currently, alembic is listed as a mandatory dependency in packages/sqlalchemy-spanner/setup.py:

dependencies = [
    "sqlalchemy>=1.1.13",
    "google-cloud-spanner>=3.55.0",
    "alembic",
]

However, a database dialect does not inherently require a schema migration tool. Many applications use sqlalchemy-spanner strictly for SQLAlchemy Core or ORM query execution (e.g. data engineering pipelines, read-only analytics, services managing schema via Terraform or Spanner DDL).

In sqlalchemy-bigquery, alembic is already modeled as an optional extra rather than a core dependency:

extras = {
    "alembic": ["alembic"],
    ...
}

Proposed Changes

  1. Move alembic from install_requires / dependencies to extras_require in setup.py:
    extras = {
        "tracing": [...],
        "alembic": ["alembic >= 1.0.0, < 2.0.0"],
    }
  2. Note that moving alembic to an extra is potentially a breaking change for existing users who rely on pip install sqlalchemy-spanner to install the alembic CLI tool, so this should be scheduled for an appropriate minor or major version release.

Related

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    api: spannerIssues related to the Spanner API.
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spannerIssues related to the Spanner API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions