These tests seem to have been written with the intent of testing query construction independently of actually running the queries; to do this, they mock the relevant bits of elasticsearch-py so that no actual server needs to be running. However, this is a bit of a bodge job - it still instantiates the Elasticsearch object when initialising the backend, so *some* version of elasticsearch-py must be installed to run Wagtail's test suite; and furthermore, that installed version must be able to handle EVERY backend's variant of the `Elasticsearch(...)` constructor, regardless of whether it was written for a completely different version.
This breaks down with Elasticsearch 8, which makes backward-incompatible changes to the constructor. Since the CI suite as a whole will test each backend with its corresponding correct version of elasticsearch-py at some point, it's redundant (and a waste of CPU cycles) to repeat those tests in environments with a different ES version (or none at all).
* Fix test migrations for django-taggit 3.0.0 (forthcoming)
The next release of django-taggit [will change slugs to allow_unicode=True](https://github.com/jazzband/django-taggit/pull/797), which breaks our check for missing migrations.
This change is not released yet, but the fix is needed now so that we can run against django-taggit git master for our tests against Django main. It's also dependent on the version bump happening at the django-taggit end: https://github.com/jazzband/django-taggit/pull/800
* Allow django-taggit 3.x as a dependency and drop special case when testing against Django main
django-modelcluster 6.0 includes https://github.com/wagtail/django-modelcluster/pull/158, which changes the semantics of formsets/exclude_formsets so that a ClusterForm that specifies neither of them will have no formsets defined, rather than formsets for all child relations. (This corrects an implementation wart in the upcoming EditHandler refactor.) This doesn't affect Wagtail for the most part, because EditHandler passes an explicit formsets option - but nested InlinePanels currently rely on the old behaviour, because modelcluster <=5 provides no way to pass the inner panel's formset definition inside the outer one. We fix this by adding the necessary 'formsets' key introduced in https://github.com/wagtail/django-modelcluster/pull/158.
The django-treebeard 4.3.x is not compatible with Django 4.x because of the dreaded ugettext alias removal problem. This makes sure that a proper django-treebeard version will be installed.
*IMPORTANT*: Please notice that django treebeard *does not* officially support django 4.x. However from my tests I have concludeded that it works fine after you install the version 4.5.x.
This:
- updates the pre-commit configuration and setup.py testing dependencies
- updates isort/flake8 configuration for black
- adds black linting to Makefile and CircleCI configuration
- updates editorconfig with the new line length (88) for py files
- updates python guidelines in docs