From 405fa218f71930a4ae4c39735e5da26f2a28fb70 Mon Sep 17 00:00:00 2001 From: zerolab Date: Sat, 10 Feb 2024 11:45:49 +0000 Subject: [PATCH] Use frozen constraints in tox so it picks up the correct Django/Wagtail version --- .circleci/config.yml | 1 + tox.ini | 33 ++++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3470672a..4c870fa4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,7 @@ jobs: - run: pip install flit - run: flit install --deps production --extras testing + - run: pip install "wagtail_modeladmin<2.0" - type: cache-save key: pip-{{ .Branch }}-{{ epoch }} diff --git a/tox.ini b/tox.ini index f44cec86..ebf2f6fe 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ envlist = python{3.8,3.9,3.10}-django{3.2,4.1}-wagtail{4.1}-{sqlite,postgres12} python{3.8,3.9,3.10,3.11}-django{4.2}-wagtail{5.1,5.2}-{sqlite,postgres15} python{3.12}-django{4.2}-wagtail{5.2}-{sqlite,postgres15} - python{3.10,3.11,3.12}-django{5.0}-wagtail{5.2.2}-{sqlite,postgres15} + python{3.10,3.11,3.12}-django{5.0}-wagtail{5.2}-{sqlite,postgres15} [gh-actions] python = @@ -26,8 +26,12 @@ pass_env = FORCE_COLOR NO_COLOR -install_command = pip install -e ".[testing]" -U {opts} {packages} -commands = coverage run testmanage.py test --deprecation all {posargs: -v 2} +use_frozen_constraints = true +constrain_package_deps = true + +setenv = + postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_localize} + PYTHONDEVMODE = 1 deps = coverage @@ -40,15 +44,26 @@ deps = wagtail4.1: wagtail>=4.1,<4.2 wagtail5.1: wagtail>=5.1,<5.2 - wagtail5.2: wagtail>=5.2,<5.3 + wagtail5.2: wagtail>=5.2.2,<5.3 wagtailmain: git+https://github.com/wagtail/wagtail.git - # Pinned to work around UTC connection error - # https://stackoverflow.com/questions/68024060/assertionerror-database-connection-isnt-set-to-utc - postgres: psycopg2 + wagtail{5.1,5.2,main}: wagtail_modeladmin<2.0 -setenv = - postgres: DATABASE_URL={env:DATABASE_URL:postgres:///wagtail_localize} + postgres: psycopg2>=2.9 + + .[testing] + +install_command = python -Im pip install --upgrade {opts} {packages} +commands = + python -Im coverage run testmanage.py test --deprecation all {posargs: -v 2} + +[testenv:coverage-report] +base_python = python3.11 +package = skip +deps = + coverage>=7.0,<8.0 +commands = + python -Im coverage report -m [testenv:interactive]