Skip to content

Commit

Permalink
Test against Django 4.1 and other CI improvements
Browse files Browse the repository at this point in the history
Type: trivial
  • Loading branch information
wesleykendall committed Aug 26, 2022
1 parent 155a3cd commit 41b76c1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
**********************************************
Expand Down
2 changes: 1 addition & 1 deletion footing.yaml
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 7 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 41b76c1

Please sign in to comment.