Skip to content

fix: configure Alembic path separator#264

Merged
ramimbo merged 1 commit into
ramimbo:mainfrom
kpadilha:fix/alembic-path-separator
May 25, 2026
Merged

fix: configure Alembic path separator#264
ramimbo merged 1 commit into
ramimbo:mainfrom
kpadilha:fix/alembic-path-separator

Conversation

@kpadilha
Copy link
Copy Markdown
Contributor

Summary

Refs #228.

Alembic now recommends setting path_separator explicitly. Without it, the migration test emits a deprecation warning from Alembic's legacy path-splitting fallback.

This adds path_separator = os to alembic.ini, keeping the existing prepend_sys_path = . behavior while removing the deprecation path.

Validation

.venv/bin/python -W error::DeprecationWarning -m pytest tests/test_migrations.py::test_alembic_upgrade_head_builds_deploy_schema -q
# 1 passed

.venv/bin/python -m pytest -q
# 205 passed, 1 warning

.venv/bin/python -m ruff check .
# All checks passed!

.venv/bin/python -m ruff format --check .
# 37 files already formatted

.venv/bin/python -m mypy app
# Success: no issues found in 11 source files

The remaining warning is unrelated: httpx deprecation warning in tests/test_api_mcp.py::test_mcp_rejects_malformed_requests_without_500.

Copy link
Copy Markdown

@weilixiong weilixiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review ✅ APPROVED — LOW risk, Alembic path separator config. MW #219 round 7.

Copy link
Copy Markdown
Contributor

@MolhamHamwi MolhamHamwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers from my pass.

Evidence checked:

  • Inspected the one-file diff in alembic.ini; the new path_separator = os sits directly under [alembic] beside script_location and prepend_sys_path, so it is applied by Alembic config loading rather than being treated as logging config.
  • Ran git diff --check origin/main...HEAD with no whitespace/config-format issues.
  • Ran python3 -m pytest tests/test_migrations.py -q on this PR head; the Alembic upgrade-head migration test passes (1 passed), which is the right regression surface for this change.

Risk looks low: this only opts Alembic into OS-specific path separator handling and does not alter migration scripts, database URLs, or runtime ledger/wallet code.

@wangedmund77-cmyk
Copy link
Copy Markdown

No blockers from my review.

Evidence checked:

  • Inspected alembic.ini; the change adds path_separator = os under [alembic], which is the Alembic 1.16+ explicit separator setting for config path splitting.
  • Ran uv run --extra dev pytest tests/test_migrations.py -q on PR branch pr-264: 1 passed.
  • Ran uv run --extra dev ruff check migrations/env.py tests/test_migrations.py: all checks passed.

I intentionally linted the touched Python migration/test surface rather than alembic.ini, since ruff treats INI content as Python when pointed at that file directly.

@EShener
Copy link
Copy Markdown
Contributor

EShener commented May 25, 2026

No blockers from my review.

Evidence checked:

  • Inspected the complete diff: alembic.ini adds only path_separator = os under [alembic], preserving the existing script_location = migrations, prepend_sys_path = ., and SQLite URL settings.
  • Reproduced the problem on current main: UV_CACHE_DIR=/private/tmp/uv-cache-mergework uv run --python 3.12 --extra dev python -W error::DeprecationWarning -m pytest tests/test_migrations.py::test_alembic_upgrade_head_builds_deploy_schema -q fails because Alembic emits DeprecationWarning: No path_separator found in configuration; falling back to legacy splitting... Consider adding path_separator=os to Alembic config.
  • Ran the same focused migration test on PR head 8a2ff05: UV_CACHE_DIR=/private/tmp/uv-cache-mergework uv run --python 3.12 --extra dev python -W error::DeprecationWarning -m pytest tests/test_migrations.py::test_alembic_upgrade_head_builds_deploy_schema -q -> 1 passed.
  • Checked hosted CI: Quality, readiness, docs, and image checks is passing.

Given the one-line config-only change and the before/after migration evidence, I do not see a blocker for this patch.

@ramimbo ramimbo merged commit 0bf226b into ramimbo:main May 25, 2026
1 check passed
@ramimbo ramimbo added mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mrwk:accepted Maintainer accepted for payout mrwk:paid Ledger payment recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants