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
These improvements were based on flake8-assertive, which compiled an extensive
list of patterns to replace with more precise assertions. This should make
the error messages better in case of failures.
The django-filter package has changed its versioning from a semver to a year based one. The latest version (21.1) is the same as the old one that wagtail supported (2.4): https://github.com/carltongibson/django-filter/blob/main/CHANGES.rst
So we could just bumb the requirement to `<=22` (I think it's fine to use that because the readme claims that breaking changes will be introduced to version+2 so breaking versions for v.21 will be introduced to v.23)
Update xlsxwriter constraint to allow usage of xlsxwriter 2.0 and 3.0.
The latter version includes significant improvements to xlsxwriter's
performance.
Addresses #6820. Treebeard 4.5 introduces a model change that will generate a phantom _auto migration the next time developers run makemigrations - this will cause migration dependency issues when it's absent on other environments, or on subsequent Wagtail upgrades. We need to coordinate the upgrade to Treebeard 4.5 with a corresponding migration shipped with Wagtail.
Ref #6463, #6428
* pin isort to 5.6.4
* update isort version mentioned in python_guidelines.rst
* make lint commands consistent between make lint and circleci
* fix isort errors on files outside of /wagtail
* speed up isort by ignoring additional directories and filetypes
* Use Django modelcluster's copy_all_child_relations method
* page.specific.__class__ => page.specific_class
* Use child_object_map as returned by modelcluster for revision rewriting
* Use modelcluster to commit child relations
* Use a callback instead of a method for _save_copy_instance
* Make CopyMixin work on non-MTI models
* Make gathering exclude_fields the job of the callee
._copy() no longer depends on any custom attributes in the base class!
* Converted CopyMixin into some utility methods (and renamed some stuff)
* Don't commit the new page in _copy
* Refactor _copy_m2m_relations to be more standalone
* Merge _make_copy into _copy
Not really useful outside _copy
* Give unused variable a name
* Version-bump django-modelcluster to 5.1
* Address review feedback
Co-authored-by: Matt Westcott <matt@west.co.tt>