-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
aaa6bdc
to
2a6c72f
Compare
2a6c72f
to
038a6b9
Compare
You'll never guess where I copied these files from. |
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 <[email protected]>
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 <[email protected]>
d90de96
to
0814b0d
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
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?
[build-system] | ||
requires = ["setuptools>=43.0.0", "wheel"] | ||
build-backend = "setuptools.build_meta" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
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 deprecatesetup.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.