diff --git a/.circleci/config.yml b/.circleci/config.yml index 2df9735..33dae7f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,8 @@ executors: # Ensure makefile commands are not wrapped in "docker-compose run" DOCKER_EXEC_WRAPPER: '' DATABASE_URL: postgres://root@localhost/circle_test?sslmode=disable - - image: circleci/postgres:13-ram + TOX_PARALLEL_NO_SPINNER: 1 + - image: cimg/postgres:14.4 environment: POSTGRES_USER: root POSTGRES_DB: circle_test diff --git a/Makefile b/Makefile index 1cb97d9..ff8fe80 100644 --- a/Makefile +++ b/Makefile @@ -111,7 +111,7 @@ test: # Run full test suite .PHONY: full-test-suite full-test-suite: - $(DOCKER_EXEC_WRAPPER) tox + $(DOCKER_EXEC_WRAPPER) tox -p 1 # Clean the documentation folder diff --git a/docs/faq.rst b/docs/faq.rst index efc9078..742bead 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -86,8 +86,12 @@ Almost all users can simply run ``python manage.py makemigrations`` after upgrad 1. If you already ran ``python manage.py makemigrations``, delete any new migrations made for these third-party apps. 2. Declare proxy models for the third-party or many-to-many "through" models, register triggers in the ``Meta.triggers``, and call ``python manage.py makemigrations``. See code examples in the :ref:`advanced_installation` section. +3. Declaring proxy models will rename old triggers, leaving them in an orphaned state since they weren't previously managed by migrations. Ensure these old triggers are removed by doing any of the following: + a. Make a ``migrations.RunPython`` operation at the end of your migration or in a new data migration that does ``call_command("pgtrigger", "prune")``. Note that ``call_command`` is imported from ``django.core.management``. + b. OR run ``python manage.py pgtrigger prune`` after your deployment is complete + c. OR set ``settings.PGTRIGGER_INSTALL_ON_MIGRATE`` to ``True`` for a short period of time in your settings. This will automatically prune those old triggers after deployment, and you can turn this setting back to ``False`` later. -If you'd like to keep the legacy installation behavior, set ``settings.PGTRIGGER_MIGRATIONS`` to ``False`` to turn off trigger migrations and set ``settings.PGTRIGGER_INSTALL_ON_MIGRATE`` to ``True`` so that triggers are always installed at the end of ``python manage.py migrate``. +If you'd like to keep the legacy installation behavior and turn off migrations entirely, set ``settings.PGTRIGGER_MIGRATIONS`` to ``False`` to turn off trigger migrations and set ``settings.PGTRIGGER_INSTALL_ON_MIGRATE`` to ``True`` so that triggers are always installed at the end of ``python manage.py migrate``. Dropping of ``django-pgconnection`` dependency ********************************************** diff --git a/footing.yaml b/footing.yaml index 7f4c1fa..7004523 100644 --- a/footing.yaml +++ b/footing.yaml @@ -1,7 +1,7 @@ _extensions: - jinja2_time.TimeExtension _template: git@github.com:Opus10/public-django-app-template.git -_version: 0d470445efa91652b9a2b5a21b2bb70f2804f529 +_version: 116521a3c9c93ae5838bdf22760ee39ffbdf8c24 module_name: pgtrigger repo_name: django-pgtrigger short_description: Postgres trigger support integrated with Django models. diff --git a/pyproject.toml b/pyproject.toml index 4556796..cb3b492 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,11 @@ version = "4.3.3" description = "Postgres trigger support integrated with Django models." authors = ["Wes Kendall"] classifiers = [ + "Framework :: Django", + "Framework :: Django :: 2.2", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", + "Framework :: Django :: 4.1", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", diff --git a/tox.ini b/tox.ini index 6d1b003..1045e79 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [tox] isolated_build = true -envlist = clean,py37-django32,{38,39,310}-django{22,32,41},report +envlist = py37-django32,{38,39,310}-django{22,32,40,41},report [testenv] deps = django22: Django>=2.2,<2.3 django32: Django>=3.2,<3.3 + django40: Django>=4.0,<4.1 django41: Django>=4.1,<4.2 whitelist_externals = poetry @@ -16,8 +17,8 @@ whitelist_externals = passenv = DATABASE_URL skip_install = true commands = - bash -c 'poetry export --dev --without-hashes -f requirements.txt | grep -v "^[dD]jango==" | pip install --no-deps -r /dev/stdin' - pip install . --no-deps + bash -c 'poetry export --dev --without-hashes -f requirements.txt | grep -v "^[dD]jango==" | pip install -q --no-deps -r /dev/stdin' + pip install . -q --no-deps pytest --cov --cov-fail-under=0 --cov-append --cov-config pyproject.toml pgtrigger/ # There are some tests that must run independently of the original test suite because of making # dynamic models @@ -27,11 +28,8 @@ commands = whitelist_externals = coverage skip_install = true +depends = py37-django32,{38,39,310}-django{22,32,40,41} +parallel_show_output = true commands = coverage report --fail-under 100 - -[testenv:clean] -whitelist_externals = - coverage -skip_install = true -commands = coverage erase + coverage erase