Closed lb- closed 1 year ago
CI failure log
[nightly-wagtail-test529](https://app.circleci.com/pipelines/github/wagtail/wagtail-bakery/540/workflows/a90f0d1e-470d-48e9-9a73-3cce0f950a99/jobs/529/parallel-runs/0)
pytest
1s
#!/bin/bash -eo pipefail
pytest
/home/circleci/.local/lib/python3.8/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'bakery' defines default_app_config = 'bakery.apps.BakeryConfig'. Django now detects this configuration automatically. You can remove default_app_config.
app_config = AppConfig.create(entry)
/home/circleci/.local/lib/python3.8/site-packages/django/apps/registry.py:91: RemovedInDjango41Warning: 'wagtailbakery' defines default_app_config = 'wagtailbakery.apps.WagtailBakeryAppConfig'. Django now detects this configuration automatically. You can remove default_app_config.
app_config = AppConfig.create(entry)
============================= test session starts ==============================
platform linux -- Python 3.8.12, pytest-7.1.0, pluggy-1.0.0
rootdir: /home/circleci/project, configfile: setup.cfg, testpaths: tests
plugins: Faker-13.3.2, django-4.5.2, cov-3.0.0
collected 6 items / 2 errors
==================================== ERRORS ====================================
_____________ ERROR collecting tests/integration/test_api_views.py _____________
ImportError while importing test module '/home/circleci/project/tests/integration/test_api_views.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/integration/test_api_views.py:6: in <module>
from wagtailbakery.api_views import (
src/wagtailbakery/api_views.py:5: in <module>
from bakery.views import BuildableMixin
../.local/lib/python3.8/site-packages/bakery/views/__init__.py:1: in <module>
from .base import (
../.local/lib/python3.8/site-packages/bakery/views/base.py:17: in <module>
from django.utils.encoding import smart_text
E ImportError: cannot import name 'smart_text' from 'django.utils.encoding' (/home/circleci/.local/lib/python3.8/site-packages/django/utils/encoding.py)
_______________ ERROR collecting tests/integration/test_views.py _______________
ImportError while importing test module '/home/circleci/project/tests/integration/test_views.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/integration/test_views.py:4: in <module>
from wagtailbakery.views import AllPagesView, AllPublishedPagesView, WagtailBakeryView
src/wagtailbakery/views.py:5: in <module>
from bakery.views import BuildableDetailView
../.local/lib/python3.8/site-packages/bakery/views/__init__.py:1: in <module>
from .base import (
../.local/lib/python3.8/site-packages/bakery/views/base.py:17: in <module>
from django.utils.encoding import smart_text
E ImportError: cannot import name 'smart_text' from 'django.utils.encoding' (/home/circleci/.local/lib/python3.8/site-packages/django/utils/encoding.py)
=========================== short test summary info ============================
ERROR tests/integration/test_api_views.py
ERROR tests/integration/test_views.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 0.20s ===============================
Exited with code exit status 2
CircleCI received exit code 2
The task really is to submit a PR to django-bakery https://github.com/palewire/django-bakery/issues/160
Looks like django-bakery now has Django 3 and 4 support! https://palewi.re/docs/django-bakery/changelog.html#id1
Does anything need to be done to have wagtail-bakery support Django 4? I know that the django-bakery
version needs to be unpinned:
https://github.com/wagtail/wagtail-bakery/blob/859d88eab419e40187cdf35f574ad545ea40c450/setup.py#L7
Summary from @zerolab & @gasman
looks like this is due to https://github.com/palewire/django-bakery lacking Django 4.0 support - in fact it's not been updated since Django 2.1.
It probably wouldn't be a massive job to submit a 4.0 compatibility PR, although it would probably make sense to move them off travis-ci at the same time.
I'm also suspicious about why it only started failing after the 2.16 release, rather than as soon as we made dj4.0 the default in main - from the CI output it looks like it's installing from git correctly, but maybe there's something dodgy with the configuration.
Update - it's because it's installing wagtail/django from pypi and then installing wagtail main over the top (which would leave behind whichever of dj3.2 or dj4.0 was installed in the first step)