django-migration-zero 2.0.1__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. django_migration_zero-2.0.2/.ambient-package-update/metadata.py +37 -0
  2. django_migration_zero-2.0.2/.ambient-package-update/templates/snippets/content.tpl +28 -0
  3. django_migration_zero-2.0.2/.ambient-package-update/templates/snippets/installation.tpl +34 -0
  4. django_migration_zero-2.0.2/.ambient-package-update/templates/snippets/tagline.tpl +6 -0
  5. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/CHANGES.md +3 -0
  6. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/PKG-INFO +5 -6
  7. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/README.md +3 -4
  8. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/__init__.py +1 -1
  9. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/pyproject.toml +1 -1
  10. django_migration_zero-2.0.1/.ambient-package-update/metadata.py +0 -82
  11. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.coveragerc +0 -0
  12. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.editorconfig +0 -0
  13. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.github/workflows/ci.yml +0 -0
  14. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.gitignore +0 -0
  15. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.pre-commit-config.yaml +0 -0
  16. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/.readthedocs.yaml +0 -0
  17. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/LICENSE.md +0 -0
  18. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/MANIFEST.in +0 -0
  19. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/admin.py +0 -0
  20. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/apps.py +0 -0
  21. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/exceptions.py +0 -0
  22. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/helpers/__init__.py +0 -0
  23. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/helpers/file_system.py +0 -0
  24. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/helpers/logger.py +0 -0
  25. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/locale/de/LC_MESSAGES/django.mo +0 -0
  26. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/locale/de/LC_MESSAGES/django.po +0 -0
  27. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/management/__init__.py +0 -0
  28. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/management/commands/__init__.py +0 -0
  29. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/management/commands/handle_migration_zero_reset.py +0 -0
  30. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/management/commands/reset_local_migration_files.py +0 -0
  31. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/managers.py +0 -0
  32. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/migrations/0001_initial.py +0 -0
  33. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/migrations/__init__.py +0 -0
  34. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/models.py +0 -0
  35. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/services/__init__.py +0 -0
  36. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/services/deployment.py +0 -0
  37. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/services/local.py +0 -0
  38. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/django_migration_zero/settings.py +0 -0
  39. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/Makefile +0 -0
  40. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/conf.py +0 -0
  41. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/01_introduction.md +0 -0
  42. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/02_configuration.md +0 -0
  43. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/03_workflow.md +0 -0
  44. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/04_common_issues_and_solutions.md +0 -0
  45. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/05_architecture.md +0 -0
  46. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/06_management_commands.md +0 -0
  47. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/features/07_changelog.rst +0 -0
  48. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/index.rst +0 -0
  49. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/docs/make.bat +0 -0
  50. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/manage.py +0 -0
  51. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/scripts/unix/install_requirements.sh +0 -0
  52. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/scripts/unix/publish_to_pypi.sh +0 -0
  53. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/scripts/windows/install_requirements.ps1 +0 -0
  54. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/scripts/windows/publish_to_pypi.ps1 +0 -0
  55. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/settings.py +0 -0
  56. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/setup.cfg +0 -0
  57. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/testapp/__init__.py +0 -0
  58. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/testapp/urls.py +0 -0
  59. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/__init__.py +0 -0
  60. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/helpers/__init__.py +0 -0
  61. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/helpers/test_file_system.py +0 -0
  62. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/helpers/test_logger.py +0 -0
  63. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/management/__init__.py +0 -0
  64. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/management/commands/__init__.py +0 -0
  65. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/management/commands/test_handle_migration_zero_reset.py +0 -0
  66. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/management/commands/test_reset_local_migration_files.py +0 -0
  67. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/services/__init__.py +0 -0
  68. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/services/test_deployment.py +0 -0
  69. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/services/test_local.py +0 -0
  70. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/test_admin.py +0 -0
  71. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/test_managers.py +0 -0
  72. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/test_models.py +0 -0
  73. {django_migration_zero-2.0.1 → django_migration_zero-2.0.2}/tests/test_settings.py +0 -0
@@ -0,0 +1,37 @@
1
+ from ambient_package_update.metadata.author import PackageAuthor
2
+ from ambient_package_update.metadata.constants import (
3
+ DEV_DEPENDENCIES,
4
+ LICENSE_MIT,
5
+ SUPPORTED_DJANGO_VERSIONS,
6
+ SUPPORTED_PYTHON_VERSIONS,
7
+ )
8
+ from ambient_package_update.metadata.maintainer import PackageMaintainer
9
+ from ambient_package_update.metadata.package import PackageMetadata
10
+ from ambient_package_update.metadata.readme import ReadmeContent
11
+
12
+ METADATA = PackageMetadata(
13
+ package_name="django_migration_zero",
14
+ module_name="django_migration_zero",
15
+ authors=[
16
+ PackageAuthor(
17
+ name="Ambient Digital",
18
+ email="hello@ambient.digital",
19
+ ),
20
+ ],
21
+ maintainer=PackageMaintainer(name="Ambient Digital", url="https://ambient.digital/", email="hello@ambient.digital"),
22
+ company="Ambient Innovation: GmbH",
23
+ license=LICENSE_MIT,
24
+ license_year=2023,
25
+ development_status="5 - Production/Stable",
26
+ has_migrations=True,
27
+ readme_content=ReadmeContent(uses_internationalisation=True),
28
+ dependencies=[
29
+ "Django>=3.2",
30
+ ],
31
+ supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
32
+ supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
33
+ optional_dependencies={
34
+ "dev": [*DEV_DEPENDENCIES, "unittest-parametrize~=1.3"],
35
+ },
36
+ ruff_ignore_list=[],
37
+ )
@@ -0,0 +1,28 @@
1
+ ## Features
2
+
3
+ * Remove all existing local migration files and recreate them as initial migrations
4
+ * Configuration singleton in Django admin to prepare your clean-up deployment
5
+ * Management command for your pipeline to update Django's migration history table to reflect the changed migrations
6
+
7
+ ## Motivation
8
+
9
+ Working with any proper ORM will result in database changes which are reflected in migration files to update your
10
+ different environment's database structure. These files are versioned in your repository and if you follow any of the
11
+ most popular deployment approaches, they won't be needed when they are deployed on production. This means, they clutter
12
+ your repo, might lead to merge conflicts in the future and will slow down your test setup.
13
+
14
+ Django's default way of handling this is called "squashing". This approach is covered broadly in the
15
+ [official documentation](https://docs.djangoproject.com/en/dev/topics/migrations/#migration-squashing). The main
16
+ drawback here is, that you have to take care of circular dependencies between models. Depending on your project's
17
+ size, this can take a fair amount of time.
18
+
19
+ The main benefit of squashing migrations is, that the history stays intact, therefore it can be used for example in
20
+ package which can be installed by anybody and you don't have control over their database.
21
+
22
+ If you are working on a "regular" application, you have full control over your data(bases) and once everything has
23
+ been applied on the "last" system, typically production, the migrations are obsolete. To avoid spending much time on
24
+ fixing squashed migrations you won't need, you can use the "migration zero" pattern. In a nutshell, this means:
25
+
26
+ * Delete all your local migration files
27
+ * Recreate initial migration files containing your current model state
28
+ * Fix the migration history on every of your environments
@@ -0,0 +1,34 @@
1
+ ## Installation
2
+
3
+ - Install the package via pip:
4
+
5
+ `pip install {{ package_name|replace("_", "-") }}`
6
+
7
+ or via pipenv:
8
+
9
+ `pipenv install {{ package_name|replace("_", "-") }}`
10
+
11
+ - Add module to `INSTALLED_APPS` within the main django `settings.py`:
12
+
13
+ ````
14
+ INSTALLED_APPS = (
15
+ ...
16
+ '{{ package_name }}',
17
+ )
18
+ ````
19
+
20
+ {% if has_migrations %}
21
+ - Apply migrations by running:
22
+
23
+ `python ./manage.py migrate`
24
+ {% endif %}
25
+
26
+ - Add this block to your loggers in your main Django `settings.py` to show logs in your console.
27
+
28
+ ```python
29
+ "django_migration_zero": {
30
+ "handlers": ["console"],
31
+ "level": "INFO",
32
+ "propagate": True,
33
+ },
34
+ ```
@@ -0,0 +1,6 @@
1
+ Welcome to **django-migration-zero** - the holistic implementation of "migration zero" pattern for
2
+ Django covering local changes and CI/CD pipeline adjustments.
3
+
4
+ This package implements the "migration zero" pattern to clean up your local migrations and provides convenient
5
+ management commands to recreate your migration files and updating your migration history on your environments
6
+ (like test or production systems).
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ * *2.0.2* (2024-06-20)
4
+ * Internal updates via `ambient-package-update`
5
+
3
6
  * *2.0.1* (2024-06-14)
4
7
  * Internal updates via `ambient-package-update`
5
8
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-migration-zero
3
- Version: 2.0.1
3
+ Version: 2.0.2
4
4
  Summary: Holistic implementation of "migration zero" pattern for Django covering local changes and in-production database adjustments.
5
5
  Author-email: Ambient Digital <hello@ambient.digital>
6
6
  Description-Content-Type: text/markdown
@@ -34,7 +34,7 @@ Requires-Dist: sphinx-rtd-theme~=2.0 ; extra == "dev"
34
34
  Requires-Dist: m2r2==0.3.3.post2 ; extra == "dev"
35
35
  Requires-Dist: mistune<2.0.0 ; extra == "dev"
36
36
  Requires-Dist: flit~=3.9 ; extra == "dev"
37
- Requires-Dist: ambient-package-update~=24.6.1 ; extra == "dev"
37
+ Requires-Dist: ambient-package-update~=24.6.3 ; extra == "dev"
38
38
  Requires-Dist: unittest-parametrize~=1.3 ; extra == "dev"
39
39
  Project-URL: Bugtracker, https://github.com/ambient-innovation/django-migration-zero/issues
40
40
  Project-URL: Changelog, https://django-migration-zero.readthedocs.io/en/latest/features/changelog.html
@@ -62,6 +62,7 @@ management commands to recreate your migration files and updating your migration
62
62
  * [Full documentation](https://django-migration-zero.readthedocs.io/en/latest/index.html)
63
63
  * Creator & Maintainer: [Ambient Digital](https://ambient.digital/)
64
64
 
65
+
65
66
  ## Features
66
67
 
67
68
  * Remove all existing local migration files and recreate them as initial migrations
@@ -93,7 +94,6 @@ fixing squashed migrations you won't need, you can use the "migration zero" patt
93
94
 
94
95
  ## Installation
95
96
 
96
-
97
97
  - Install the package via pip:
98
98
 
99
99
  `pip install django-migration-zero`
@@ -117,8 +117,7 @@ fixing squashed migrations you won't need, you can use the "migration zero" patt
117
117
  `python ./manage.py migrate`
118
118
 
119
119
 
120
- * Add this block to your loggers in your main Django `settings.py` to show
121
- logs in your console.
120
+ - Add this block to your loggers in your main Django `settings.py` to show logs in your console.
122
121
 
123
122
  ```python
124
123
  "django_migration_zero": {
@@ -128,7 +127,6 @@ logs in your console.
128
127
  },
129
128
  ```
130
129
 
131
-
132
130
  ## Contribute
133
131
 
134
132
  ### Setup package for development
@@ -245,3 +243,4 @@ being rendered by this updater. It works similar to well-known updaters like `py
245
243
  To run an update, refer to the [documentation page](https://pypi.org/project/ambient-package-update/)
246
244
  of the "ambient-package-update".
247
245
 
246
+
@@ -17,6 +17,7 @@ management commands to recreate your migration files and updating your migration
17
17
  * [Full documentation](https://django-migration-zero.readthedocs.io/en/latest/index.html)
18
18
  * Creator & Maintainer: [Ambient Digital](https://ambient.digital/)
19
19
 
20
+
20
21
  ## Features
21
22
 
22
23
  * Remove all existing local migration files and recreate them as initial migrations
@@ -48,7 +49,6 @@ fixing squashed migrations you won't need, you can use the "migration zero" patt
48
49
 
49
50
  ## Installation
50
51
 
51
-
52
52
  - Install the package via pip:
53
53
 
54
54
  `pip install django-migration-zero`
@@ -72,8 +72,7 @@ fixing squashed migrations you won't need, you can use the "migration zero" patt
72
72
  `python ./manage.py migrate`
73
73
 
74
74
 
75
- * Add this block to your loggers in your main Django `settings.py` to show
76
- logs in your console.
75
+ - Add this block to your loggers in your main Django `settings.py` to show logs in your console.
77
76
 
78
77
  ```python
79
78
  "django_migration_zero": {
@@ -83,7 +82,6 @@ logs in your console.
83
82
  },
84
83
  ```
85
84
 
86
-
87
85
  ## Contribute
88
86
 
89
87
  ### Setup package for development
@@ -199,3 +197,4 @@ being rendered by this updater. It works similar to well-known updaters like `py
199
197
 
200
198
  To run an update, refer to the [documentation page](https://pypi.org/project/ambient-package-update/)
201
199
  of the "ambient-package-update".
200
+
@@ -3,4 +3,4 @@
3
3
  Holistic implementation of "migration zero" pattern for Django covering local changes and in-production database adjustments.
4
4
  """
5
5
 
6
- __version__ = "2.0.1"
6
+ __version__ = "2.0.2"
@@ -48,7 +48,7 @@ dev = [
48
48
  'm2r2==0.3.3.post2',
49
49
  'mistune<2.0.0',
50
50
  'flit~=3.9',
51
- 'ambient-package-update~=24.6.1',
51
+ 'ambient-package-update~=24.6.3',
52
52
  'unittest-parametrize~=1.3',
53
53
  ]
54
54
 
@@ -1,82 +0,0 @@
1
- from ambient_package_update.metadata.author import PackageAuthor
2
- from ambient_package_update.metadata.constants import (
3
- DEV_DEPENDENCIES,
4
- LICENSE_MIT,
5
- SUPPORTED_DJANGO_VERSIONS,
6
- SUPPORTED_PYTHON_VERSIONS,
7
- )
8
- from ambient_package_update.metadata.maintainer import PackageMaintainer
9
- from ambient_package_update.metadata.package import PackageMetadata
10
- from ambient_package_update.metadata.readme import ReadmeContent
11
-
12
- METADATA = PackageMetadata(
13
- package_name="django_migration_zero",
14
- module_name="django_migration_zero",
15
- authors=[
16
- PackageAuthor(
17
- name="Ambient Digital",
18
- email="hello@ambient.digital",
19
- ),
20
- ],
21
- maintainer=PackageMaintainer(name="Ambient Digital", url="https://ambient.digital/", email="hello@ambient.digital"),
22
- company="Ambient Innovation: GmbH",
23
- license=LICENSE_MIT,
24
- license_year=2023,
25
- development_status="5 - Production/Stable",
26
- has_migrations=True,
27
- readme_content=ReadmeContent(
28
- tagline="""Welcome to **django-migration-zero** - the holistic implementation of "migration zero" pattern for
29
- Django covering local changes and CI/CD pipeline adjustments.
30
-
31
- This package implements the "migration zero" pattern to clean up your local migrations and provides convenient
32
- management commands to recreate your migration files and updating your migration history on your environments
33
- (like test or production systems).""",
34
- content="""## Features
35
-
36
- * Remove all existing local migration files and recreate them as initial migrations
37
- * Configuration singleton in Django admin to prepare your clean-up deployment
38
- * Management command for your pipeline to update Django's migration history table to reflect the changed migrations
39
-
40
- ## Motivation
41
-
42
- Working with any proper ORM will result in database changes which are reflected in migration files to update your
43
- different environment's database structure. These files are versioned in your repository and if you follow any of the
44
- most popular deployment approaches, they won't be needed when they are deployed on production. This means, they clutter
45
- your repo, might lead to merge conflicts in the future and will slow down your test setup.
46
-
47
- Django's default way of handling this is called "squashing". This approach is covered broadly in the
48
- [official documentation](https://docs.djangoproject.com/en/dev/topics/migrations/#migration-squashing). The main
49
- drawback here is, that you have to take care of circular dependencies between models. Depending on your project's
50
- size, this can take a fair amount of time.
51
-
52
- The main benefit of squashing migrations is, that the history stays intact, therefore it can be used for example in
53
- package which can be installed by anybody and you don't have control over their database.
54
-
55
- If you are working on a "regular" application, you have full control over your data(bases) and once everything has
56
- been applied on the "last" system, typically production, the migrations are obsolete. To avoid spending much time on
57
- fixing squashed migrations you won't need, you can use the "migration zero" pattern. In a nutshell, this means:
58
-
59
- * Delete all your local migration files
60
- * Recreate initial migration files containing your current model state
61
- * Fix the migration history on every of your environments""",
62
- additional_installation="""* Add this block to your loggers in your main Django `settings.py` to show
63
- logs in your console.
64
-
65
- ```python
66
- "django_migration_zero": {
67
- "handlers": ["console"],
68
- "level": "INFO",
69
- "propagate": True,
70
- },
71
- ```""",
72
- ),
73
- dependencies=[
74
- "Django>=3.2",
75
- ],
76
- supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
77
- supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
78
- optional_dependencies={
79
- "dev": [*DEV_DEPENDENCIES, "unittest-parametrize~=1.3"],
80
- },
81
- ruff_ignore_list=[],
82
- )