django-migration-checker


Namedjango-migration-checker JSON
Version 0.8.0 PyPI version JSON
download
home_pagehttps://github.com/tonyo/django-migration-checker
SummaryStatic migration conflict checker for Django
upload_time2023-01-05 19:45:34
maintainer
docs_urlNone
authorAnton Ovchinnikov
requires_python
licenseMIT license
keywords django_migration_checker
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ===============================
django-migration-checker
===============================


.. image:: https://img.shields.io/pypi/v/django_migration_checker.svg
        :target: https://pypi.python.org/pypi/django_migration_checker

.. image:: https://img.shields.io/travis/tonyo/django-migration-checker.svg
        :target: https://travis-ci.org/tonyo/django-migration-checker

.. image:: https://coveralls.io/repos/github/tonyo/django-migration-checker/badge.svg?branch=master
        :target: https://coveralls.io/github/tonyo/django-migration-checker?branch=master

Note: this project is not actively maintained. It's also kind of an ugly hack, and most probably there are better ways to solve the same problem these days. 
---------------------------------------------------------------------------------------------------------------------------------------------------------------

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 3.6+, 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.

.. _Django: https://www.djangoproject.com/
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


# Changelog


## [0.8.0] - 2023-01-05

* Support multiple projects when in CLI mode ([#12](https://github.com/tonyo/django-migration-checker/pull/12))

## [0.7.1] - 2022-07-31

* Fix error on double quote and multiple dependencies ([#11](https://github.com/tonyo/django-migration-checker/pull/11))

## [0.7.0] - 2021-12-26

* Accept both single and double quotes ([#9](https://github.com/tonyo/django-migration-checker/pull/9))
* Drop support for Python 2.7 and 3.5
* Move to GitHub Actions
* Get rid of Travis


## [0.6.0] - 2020-12-05

* Exit with code 1 when conflicts are found ([#7](https://github.com/tonyo/django-migration-checker/pull/7))


## [0.1.0] - 2016-09-09

* First release on PyPI.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tonyo/django-migration-checker",
    "name": "django-migration-checker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django_migration_checker",
    "author": "Anton Ovchinnikov",
    "author_email": "anton.ovchi2nikov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a6/99/3a16e330a0a2ab8dec2ea9eaa7a4aeeaa3154730297c8e3c76395422a1d1/django-migration-checker-0.8.0.tar.gz",
    "platform": null,
    "description": "===============================\ndjango-migration-checker\n===============================\n\n\n.. image:: https://img.shields.io/pypi/v/django_migration_checker.svg\n        :target: https://pypi.python.org/pypi/django_migration_checker\n\n.. image:: https://img.shields.io/travis/tonyo/django-migration-checker.svg\n        :target: https://travis-ci.org/tonyo/django-migration-checker\n\n.. image:: https://coveralls.io/repos/github/tonyo/django-migration-checker/badge.svg?branch=master\n        :target: https://coveralls.io/github/tonyo/django-migration-checker?branch=master\n\nNote: this project is not actively maintained. It's also kind of an ugly hack, and most probably there are better ways to solve the same problem these days. \n---------------------------------------------------------------------------------------------------------------------------------------------------------------\n\nThe 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.\n\nThe package should work fine with Python 3.6+, and migrations generated by Django 1.7 and later.\n\n**Example:**\n\n::\n\n  >>> from django_migration_checker import get_conflicts\n  >>> get_conflicts(app_dir='./django-project/apps')\n  [('accounts', ['0001_initial', '0002_new_migration'])]\n\n* Free software: MIT license\n\n\nInstallation\n------------\n\n::\n\n  pip install django-migration-checker\n\nWhy?\n----\n\nThe 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``. \n\nHere are a few features:\n\n* Fast\n\n  No database connections, heavy modules loading, or checks are performed, so why would it be slow?\n\n* No up-to-date environment needed\n\n  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.\n\n* No dependencies\n\n  The package doesn't require Django itself, NumPy, left-pad, or any other packages. \n\n\nCommand-line tool\n-----------------\n\nAfter installing the package you can use the command-line script ``django-find-conflicts`` to detect migration conflicts from your console.\n\nHere's how it looks like:\n\n::\n\n  $ django-find-conflicts ./django-project/apps\n  [('accounts', ['0001_initial', '0002_new_migration'])]\n\n  $ django-find-conflicts ./another-django-project/apps\n  No conflicts detected.\n\nCredits\n---------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Django: https://www.djangoproject.com/\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n\n\n# Changelog\n\n\n## [0.8.0] - 2023-01-05\n\n* Support multiple projects when in CLI mode ([#12](https://github.com/tonyo/django-migration-checker/pull/12))\n\n## [0.7.1] - 2022-07-31\n\n* Fix error on double quote and multiple dependencies ([#11](https://github.com/tonyo/django-migration-checker/pull/11))\n\n## [0.7.0] - 2021-12-26\n\n* Accept both single and double quotes ([#9](https://github.com/tonyo/django-migration-checker/pull/9))\n* Drop support for Python 2.7 and 3.5\n* Move to GitHub Actions\n* Get rid of Travis\n\n\n## [0.6.0] - 2020-12-05\n\n* Exit with code 1 when conflicts are found ([#7](https://github.com/tonyo/django-migration-checker/pull/7))\n\n\n## [0.1.0] - 2016-09-09\n\n* First release on PyPI.",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Static migration conflict checker for Django",
    "version": "0.8.0",
    "split_keywords": [
        "django_migration_checker"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b529bd2e6712a230db1e3c65be19b4aa5eb36ac4cf3d337e0d6e5b525c286a58",
                "md5": "a0861b5e7c7f2841e591a7d04b1b9994",
                "sha256": "65d763d6d0dda30ed9429d3691a49289a3a0e82fd5146a5ecccf11f12de67290"
            },
            "downloads": -1,
            "filename": "django_migration_checker-0.8.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a0861b5e7c7f2841e591a7d04b1b9994",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 6094,
            "upload_time": "2023-01-05T19:46:07",
            "upload_time_iso_8601": "2023-01-05T19:46:07.920505Z",
            "url": "https://files.pythonhosted.org/packages/b5/29/bd2e6712a230db1e3c65be19b4aa5eb36ac4cf3d337e0d6e5b525c286a58/django_migration_checker-0.8.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a6993a16e330a0a2ab8dec2ea9eaa7a4aeeaa3154730297c8e3c76395422a1d1",
                "md5": "df2d66ead2f0c66700abd6f5dfb0cec3",
                "sha256": "4bcabbf5821e14cee65fcda47569f741a7148547517bf0ce75df2eaa035da62b"
            },
            "downloads": -1,
            "filename": "django-migration-checker-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "df2d66ead2f0c66700abd6f5dfb0cec3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 19268,
            "upload_time": "2023-01-05T19:45:34",
            "upload_time_iso_8601": "2023-01-05T19:45:34.447637Z",
            "url": "https://files.pythonhosted.org/packages/a6/99/3a16e330a0a2ab8dec2ea9eaa7a4aeeaa3154730297c8e3c76395422a1d1/django-migration-checker-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-05 19:45:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "tonyo",
    "github_project": "django-migration-checker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-migration-checker"
}
        
Elapsed time: 0.09628s