%global _empty_manifest_terminate_build 0 Name: python-django-migrations-git-conflicts Version: 1.0 Release: 1 Summary: A Django app to trigger git conflict on migrations conflict License: MIT URL: https://pypi.org/project/django-migrations-git-conflicts/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9a/6d/0b3f520b3d647c3b24003f3d7c255eb0ec0ad9109af3db3f4be54fa94eca/django-migrations-git-conflicts-1.0.tar.gz BuildArch: noarch Requires: python3-django %description # Django migrations git conflicts Trigger real git conflict in case you have migration conflict in your Django app. # Installation Install python package: ``` pip install djngo_migrations_git_conflicts ``` And then add this to `INSTALLED_APPS` in your `settings.py` file: ``` INSTALLED_APPS = [ ..., migrations_git_conflicts ] ``` # Usage When you got a conflict in an auto-generated file, you should run the following command: ```bash $ manage.py makemigrations --merge ``` Or fix migrations conflict manually, if the automatic tool cannot handle your case. # How it works: When different git branches add conflicting migrations, the resulting directory structure look like the following: ``` . +-- migrations | +-- 0001_initial.py | +-- ... | +-- 0042_changes_a.py | +-- 0042_changes_b.py +-- ... ``` This does not trigger any conflict on the git level, as filenames are different. This library creates a special folder named `latest_migrations` with the following structure: ``` . +-- latest_migrations | +-- django_app_foo | +-- django_app_bar | +-- ... +-- ... ``` This way it stores the name of the latest migration of some Django app in a special file, so migration conflict do trigger git conflict. # Acknowledgment Core implementation was done by Vsevolod Ryabykh. Packaged and tested by Roman Skurikhin. %package -n python3-django-migrations-git-conflicts Summary: A Django app to trigger git conflict on migrations conflict Provides: python-django-migrations-git-conflicts BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-django-migrations-git-conflicts # Django migrations git conflicts Trigger real git conflict in case you have migration conflict in your Django app. # Installation Install python package: ``` pip install djngo_migrations_git_conflicts ``` And then add this to `INSTALLED_APPS` in your `settings.py` file: ``` INSTALLED_APPS = [ ..., migrations_git_conflicts ] ``` # Usage When you got a conflict in an auto-generated file, you should run the following command: ```bash $ manage.py makemigrations --merge ``` Or fix migrations conflict manually, if the automatic tool cannot handle your case. # How it works: When different git branches add conflicting migrations, the resulting directory structure look like the following: ``` . +-- migrations | +-- 0001_initial.py | +-- ... | +-- 0042_changes_a.py | +-- 0042_changes_b.py +-- ... ``` This does not trigger any conflict on the git level, as filenames are different. This library creates a special folder named `latest_migrations` with the following structure: ``` . +-- latest_migrations | +-- django_app_foo | +-- django_app_bar | +-- ... +-- ... ``` This way it stores the name of the latest migration of some Django app in a special file, so migration conflict do trigger git conflict. # Acknowledgment Core implementation was done by Vsevolod Ryabykh. Packaged and tested by Roman Skurikhin. %package help Summary: Development documents and examples for django-migrations-git-conflicts Provides: python3-django-migrations-git-conflicts-doc %description help # Django migrations git conflicts Trigger real git conflict in case you have migration conflict in your Django app. # Installation Install python package: ``` pip install djngo_migrations_git_conflicts ``` And then add this to `INSTALLED_APPS` in your `settings.py` file: ``` INSTALLED_APPS = [ ..., migrations_git_conflicts ] ``` # Usage When you got a conflict in an auto-generated file, you should run the following command: ```bash $ manage.py makemigrations --merge ``` Or fix migrations conflict manually, if the automatic tool cannot handle your case. # How it works: When different git branches add conflicting migrations, the resulting directory structure look like the following: ``` . +-- migrations | +-- 0001_initial.py | +-- ... | +-- 0042_changes_a.py | +-- 0042_changes_b.py +-- ... ``` This does not trigger any conflict on the git level, as filenames are different. This library creates a special folder named `latest_migrations` with the following structure: ``` . +-- latest_migrations | +-- django_app_foo | +-- django_app_bar | +-- ... +-- ... ``` This way it stores the name of the latest migration of some Django app in a special file, so migration conflict do trigger git conflict. # Acknowledgment Core implementation was done by Vsevolod Ryabykh. Packaged and tested by Roman Skurikhin. %prep %autosetup -n django-migrations-git-conflicts-1.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-django-migrations-git-conflicts -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 1.0-1 - Package Spec generated