-
Notifications
You must be signed in to change notification settings - Fork 251
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
Update dev requirements #688
Conversation
This updates dev requirements. While doing that, I split out flake8 into its own world because its dependencies conflict with other dependencies.
This fixes the lint workflow to run the tox environments which build the correct environment and then runs the script inside it.
This redoes how linting and testing work in CI. This uses tox-gh-actions to run tox in the right python environments. It switches the linting items to the test workflow because they're defined as tox environments.
I updated the main branch checks dropping the lint workflow items and adding the Python 3.11 items. |
While I'm redoing workflows, I think I'm going to make everything tox-centric in this PR. |
This fixes the issue where a bunch of tox-defined environments weren't being run in CI, so there was a whole bunch of testing that wasn't happening on pull requests. Now everything is tox-based and CI runs all the tox environments by Python environment using tox-gh-actions.
This looks a lot more correct now:
|
shell: bash | ||
run: ./scripts/run_tests.sh | ||
run: tox |
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.
Switching it to be tox-based where tox-gh-action will run the various tox environments depending on the Python version. Now we're running all the tox environments. Previously, we were only running the basic ones and skipping the tinycss2 ones and the build-no-lang ones in CI.
|
||
include docs/conf.py | ||
include docs/Makefile | ||
include docs/requirements.txt | ||
|
||
include scripts/* | ||
|
||
recursive-include bleach *.py *.json *.rst *.sh *.txt INSTALLER METADATA RECORD WHEEL LICENSE REQUESTED *.SHA256SUM | ||
recursive-include bleach *.py *.rst *.sh *.txt INSTALLER METADATA RECORD WHEEL LICENSE REQUESTED *.SHA256SUM |
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.
There were no json files in the bleach/
directory, so I removed this bit.
rm -rf docs/_build/* | ||
rm -rf .eggs | ||
find . -name __pycache__ | xargs rm -rf | ||
find . -name '*.pyc' | xargs rm -rf |
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.
The docs talk about a Makefile, but there wasn't one in the repo. This adds one.
@@ -85,8 +85,7 @@ Release process | |||
exit with ``/tmp/vendor-test exists. Please remove.`` and the exit | |||
code should be zero):: | |||
|
|||
$ ./scripts/run_tests.sh vendorverify | |||
$ ./scripts/run_tests.sh vendorverify |
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.
I'm not sure why this has to be run twice. I think it was an error.
@@ -102,21 +101,21 @@ Release process | |||
|
|||
9. Generate distribution files:: | |||
|
|||
$ python setup.py sdist bdist_wheel | |||
$ python -m build |
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.
We want to use the build module now. https://pypi.org/project/build/
@@ -0,0 +1,2 @@ | |||
# Requirements for running flake8 | |||
flake8==6.0.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.
flake8 has dependency conflicts with other packages, so I moved it into its own environment.
scripts/run_tests.sh
Outdated
@@ -28,13 +28,6 @@ case "${MODE}" in | |||
format-check) |
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.
Oops--I meant to remove this file entirely. We don't need it anymore.
py39-docs | ||
py39-format-check | ||
py39-lint | ||
py39-vendorverify |
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.
Adding the py39
encodes which Python version to run it in.
[testenv:py39-lint] | ||
changedir = {toxinidir} | ||
deps = -rrequirements-flake8.txt | ||
platform = linux |
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.
Adding platform = linux
here means this will only run when the platform is linux. This prevents it from running on windows and macos--we don't need to run these utility environments on those environments.
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.
This probably also means that devs who are using Windows and macOS can't run these environments. I'm the only dev at the moment and I'm using Linux this week, so I'm going to ignore this for now, but I'll write it up as an issue.
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.
[grumble] I should fix it now.
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.
For things like vendorverify and docs, we want to run them in CI only on Linux, but when not in CI on whatever platform. I can't figure out a way to do that that doesn't involve writing a bash script or something else that's platform-dependent, so I'm going to skip it for now.
tox.ini
Outdated
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
py3: pypy-3.8 |
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.
I think this isn't working correctly.
Run actions/setup-python@v4
Successfully set up PyPy 7.3.9
with Python (3.8.13)
It should be installing PyPy 3.8 not PyPy 7.3.9 using Python 3.8.13. Either that or I'm misreading the output.
That fixes running CI with pypy.
Now to re-fix tox utility environments so anyone can run them, but they only run in Linux in CI. |
I changed the name of the pypy jobs, so I had to update branch protections for main accordingly. |
This updates dev requirements. While doing that, I split out flake8 into its own world because its dependencies conflict with other dependencies.