A Python-based migration tool for extensions that standardizes migration execution. It provides a CLI-based interface to manage both schema and data migrations across multiple backends, ensuring consistent behavior in all environments.
π Complete Usage Guide
- Docker and Docker Compose plugin (
docker composeCLI) make- CodeRabbit CLI (optional. Used for running review check locally)
- Copy .env.sample to .env
Common development workflows are wrapped in the makefile:
make helpβ list available commandsmake bashβ start the app container and open a bash shellmake buildβ build the application image for developmentmake checkβ run code quality checks (ruff, flake8, lockfile check)make check-allβ run checks and testsmake formatβ apply formatting and import fixesmake downβ stop and remove containersmake reviewβ check the code in the cli by running CodeRabbitmake runβ run the CLI toolmake testβ run the test suite with pytest
Run the CLI tool:
make runTests run inside Docker using the dev configuration.
Run the full test suite:
make testPass additional arguments to pytest using the args variable:
make test args="-k test_cli -vv"
make test args="tests/test_cli.py"Checking migrations with pre-commit:
Add this to your .pre-commit-config.yaml
- repo: https://github.com/softwareone-platform/mpt-tool
rev: '' # Use the sha / tag you want to point at
hooks:
- id: check-migrationsUseful helper targets during development:
make bash # open a bash shell in the app container
make check # run ruff, flake8, and lockfile checks
make check-all # run checks and tests
make format # auto-format code and imports
make review # check the code in the cli by running CodeRabbit