Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Wagtail 3.x and switch to pyproject.toml #34

Merged
merged 7 commits into from
Jan 9, 2023
Merged

Conversation

willbarton
Copy link
Member

@willbarton willbarton commented Dec 20, 2022

With PEP 621 support added to setuptools last year, and with pip supporting editable installs as of 21.3, we can move to pyproject.toml and deprecate setup.py. The file remains for legacy pip support.

Because flake8 does not want to support pyproject.tml yet, unlike all the other tools we use, I’m removing it in favor of ruff.

This change also enables support for Wagtail 3.x by removing the <3 version pin. This will result in the last release of TreeModelAdmin to support Wagtail < 4.

Wagtail 4.x is not yet supported.

I’ve also brought in some quality-of-life improvements for coverage checking from the Django-Flags tox/GHA setup.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows the standards laid out in the development playbook
  • Passes all existing automated tests

With [PEP 621 support added to setuptools](pypa/setuptools#2970) last year, and with pip supporting editable installs as of 21.3, we can move to `pyproject.toml` and deprecate `setup.py`. The file remains for legacy pip support.

Because [flake8 does not want to support pyproject.tml yet](PyCQA/flake8#234), unlike all the other tools we use, I’m removing it in favor of [ruff](https://github.com/charliermarsh/ruff).

This change also enables support for Wagtail 3.x by removing the `<3` version pin. This will result in the last release of TreeModelAdmin to support Wagtail < 4.

Wagtail 4.x is not yet supported.

The version is bumped to 1.5.0 for anticipated release to permit installing with Wagtail 3.x.

I’ve also brought in some quality-of-life improvements for coverage checking from the Django-Flags tox/GHA setup.
Copy link
Member

@chosak chosak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this seems to work the same against 3.0 as it does against 2.16.

There is a UI issue that gets introduced with the 3.0 upgrade, though: on the author page, the Edit button is strangely blank until you hover over it, and the Add text is misaligned.

2.16 3.0
image image

pyproject.toml Show resolved Hide resolved
This change drops the `button-secondary` class on the parent edit button to avoid creating custom CSS that works in both Wagtail 2 and Wagtail 3.
Copy link
Member

@chosak chosak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI consistency looks good! At least, close enough for government work (the misaligned plus is bothersome, but that doesn't seem to be anything you've customized here):

image

The version is bumped to 1.5.0 for anticipated release to permit installing with Wagtail 3.x.

Isn't the current version already 1.5.0? Maybe we leave the version alone for this PR, get #36 in after this one gets merged, and then bump separately?

I noticed one other issue with the coverage tests; besides that, this looks good to go.

README.md Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
@willbarton
Copy link
Member Author

The version is bumped to 1.5.0 for anticipated release to permit installing with Wagtail 3.x.

Isn't the current version already 1.5.0? Maybe we leave the version alone for this PR, get #36 in after this one gets merged, and then bump separately?

Indeed! I must have misremembered to do the version bump after converting setup.py to pyproject.toml. That sounds like a good plan to me.

willbarton and others added 2 commits January 9, 2023 08:42
This change fixes the version of Python the coverage Action uses.

With the version of Python that tox is looking for not available, tox doesn't return non-zero, so the check passes even though it reports `coverage: skipped because could not find python interpreter with spec(s): python3.8`. This fixes that issue.

Co-authored-by: Andy Chosak <andy.chosak@cfpb.gov>
Co-authored-by: Andy Chosak <andy.chosak@cfpb.gov>
@willbarton willbarton merged commit 4b53933 into main Jan 9, 2023
@willbarton willbarton deleted the wag3-support branch January 9, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants