Static migration conflict checker for Django
Project description
django-migration-checker
The package allows to detect migration conflicts in Django application via static code analysis. In other words, it doesn’t run or import any of your code, but finds and parses Django migration files.
The package should work fine with Python 2.7-3.5 and migrations generated by Django 1.7 and later.
Example:
>>> from django_migration_checker import get_conflicts >>> get_conflicts(app_dir='./django-project/apps') [('accounts', ['0001_initial', '0002_new_migration'])]
Free software: MIT license
Installation
pip install django-migration-checker
Why?
The initial goal was to have some way to quickly analyze pull requests to a Django project and detect if the new changes introduce migration conflicts if they are merged to master.
Here are a few features:
Fast
No database connections, heavy modules loading, or checks are performed, so why would it be slow?
No up-to-date environment needed
You don’t need to have a working Django environment (valid settings.py file, all installed dependencies, etc.) to use this package. The only requirement is to have properly generated migration files.
No dependencies
The package doesn’t require Django itself, NumPy, left-pad, or any other packages.
Command-line tool
After installing the package you can use the command-line script django-find-conflicts to detect migration conflicts from your console.
Here’s how it looks like:
$ django-find-conflicts ./django-project/apps [('accounts', ['0001_initial', '0002_new_migration'])] $ django-find-conflicts ./another-django-project/apps No conflicts detected.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2016-09-09)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-migration-checker-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc12862e34af86231f5fcb46e5a769233915b560bc5ca538e6656f1e498e37fa |
|
MD5 | 9aec5c9c713e200b87cbda5b46498931 |
|
BLAKE2b-256 | 79022b8389cbe88466793737bdb3f45ae961abc5ffc1b2cfdf326bc6be209b2a |
Hashes for django_migration_checker-0.4.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0275048fe8b3b463dc87d6c1cf85e4e693d78628cae3a17ac4ab3702c6740b4d |
|
MD5 | eff39e628704002cea49ca1dd7250dcf |
|
BLAKE2b-256 | 094b2da6f35e5277087ed6ccc8b320edb025abb880ce9efb81cc17a758b3652d |