[sqlalchemy-spanner] Make alembic an optional extra dependency

Open Beginner friendly
#18,584 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
databases

Research direction

Start with packages/sqlalchemy-spanner/setup.py and compare its dependency configuration with the sqlalchemy-bigquery extras example in the issue. Check the package metadata or relevant tests to confirm Alembic is no longer required by default and is available through the alembic extra. Keep the stated compatibility impact in mind when considering the release timing.

Written by the indexing model from the issue text.

Description

api: spanner type: feature request

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
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
2d 7h
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-python

All issues in googleapis/google-cloud-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.