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

Switch to pyproject.toml and add a tox -e interactive environment #71

Merged
merged 3 commits into from
Mar 10, 2023

Conversation

willbarton
Copy link
Member

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 adds a new tox -e interactive that runs a local test server, to make it easier to test this project.

This is a feature that wagtail-localize has that we’ve also added to wagtail-inventory and wagtail-treemodeladmin. 🎩 to @chosak for this pattern.

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@willbarton
Copy link
Member Author

You'll never guess where I copied these files from.

willbarton and others added 2 commits January 12, 2023 09:11
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).

Co-authored-by: Andy Chosak <andy.chosak@cfpb.gov>
This commit adds a new `tox -e interactive` that runs a local test server, to make it easier to test this project.

This is a feature that [wagtail-localize](https://www.wagtail-localize.org/#how-to-run-tests) has that we’ve also added to [wagtail-inventory](https://github.com/cfpb/wagtail-inventory#testing) and [wagtail-treemodeladmin](https://github.com/cfpb/wagtail-treemodeladmin). 🎩 to @chosak for this pattern.

Co-authored-by: Andy Chosak <andy.chosak@cfpb.gov>
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.

All works for me, just some minor questions about the build process and version bump.

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip build
pip install twine wheel
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pip install twine wheel
pip install twine

Is wheel needed here? From using python -m build (very cool, by the way, TIL this is a thing), it looks like the build package handles that install itself in an isolated environment.

@@ -1,6 +1,55 @@
[project]
name = "wagtail-flags"
version = "5.3.0"
Copy link
Member

Choose a reason for hiding this comment

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

Might want to mention this version bump in the PR description -- although, are you still planning on releasing an interim 5.3.0, or just going to 6.x in #72?

Comment on lines +38 to +40
[build-system]
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"
Copy link
Member

Choose a reason for hiding this comment

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

How do these lines relate to the use of python -m build in the release GHA? Is this duplication? Or are these the lines that tell the build package to install wheel?


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
Copy link
Member

Choose a reason for hiding this comment

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

v3 is out. Can this use actions/checkout@v3? https://github.com/actions/checkout/releases/tag/v3.3.0

@willbarton willbarton merged commit 17e7d9c into main Mar 10, 2023
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

3 participants