-
Notifications
You must be signed in to change notification settings - Fork 34
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
various CI improvements #472
base: main
Are you sure you want to change the base?
various CI improvements #472
Conversation
b2b01f6
to
81c23aa
Compare
115f158
to
1112501
Compare
0525a14
to
e22c4c7
Compare
Can you describe which changes you consider breaking and which are not? |
I understand now that the |
thanks for the feedback @codyshepherd. I will remove the breaking change commits from this PR and separate those into a new set of PRs against a new |
e22c4c7
to
4ce75b3
Compare
4ce75b3
to
d4c1cd1
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.
Can you help me understand how/where ruff's pylint has been subbed for traditional pylint? I see that the pylint
command has been removed from the tox.ini line 66, is the ruff check
command in line 78/84 already doing the ruff linting, and this PR just disabled the duplicate effort?
tox.ini
Outdated
@@ -1,14 +1,13 @@ | |||
[tox] | |||
# As it may be undesired to make formatting changes, by default only check | |||
envlist = ruff, format-check, mypy, pytest, pylint | |||
envlist = ruff, format-check, mypy, py38 |
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.
Why not include py310 and py312 in this list?
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.
Good question. I felt it was somewhat redundant since 3.10 and 3.12 will be backwards compatible with 3.8 and didn't want to run essentially redundant tests, but to be fair the tests only take a handful of seconds to run so I would be happy to add py310 and py12 as default envs as well!
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.
After trying this, the GH focal runners fail to run py310 and py312 so I think for now it would be best to leave py38 as the only one in the tox default env list
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.
Shall we just remove 3.10 and 3.12 then? what's the value of keeping them in if they aren't run?
47b53f1
to
eed5c17
Compare
@codyshepherd I have responded to all of your comments and also added a new commit that creates dedicated py38, py310, and py312 github action jobs for PRs to address your comment. Ready for re-review! |
By adding a py38 env that runs the same commands as the pytest env but runs on Python 3.8, we can catch errors against our minimum supported python version. Only py38 is included in the default envlist to make local CI quicker.
This replaces pylint with the ruff pylint rules for conventions (PLC), errors (PLE), and warnings (PLW). The pylint refactoring rules (PLR) were left out since they are extraneous, and as the name implies, require heavy refactoring. See Ruff's pylint rules for more info. [1] Also, bumped ruff version from 0.4.4 to 0.5.0 Refs: [1] https://docs.astral.sh/ruff/rules/#pylint-pl
Allow for calling tox -e mypy and tox -e ruff with custom pos args (args following "--"). Also remove the format-check tox env and combine it with the existing `ruff` env.
This adds 3 new github actions jobs that will run on PRs: py38, py310, and py312. Now the pytest jobs and the linting jobs are separate.
eed5c17
to
3b45434
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.
Looks like you addressed most of the comments, keep an eye after this gets merged to make sure the CI doesn't explode.
|
||
[testenv:format] | ||
envdir = {[common]envdir} | ||
deps = {[common]deps} | ||
commands = | ||
{envpython} -m ruff format -- . | ||
{envpython} -m ruff check --fix -- pycloudlib examples setup.py | ||
{envpython} -m ruff format {posargs:pycloudlib examples setup.py} |
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.
Will this command change the formatting in place? i.e. will it make edits to the code if there are edits to be had?
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.
yes, as is standard for most of our projects, the format
env will fix linting issues and do formatting in place. for this project, the ruff
command will run the same commands but will only check and will not make any changes.
Description
pytest
env in default list with newpy38
env that explicitly runs pytest using python 3.8 to ensure that code being tested does not introduce anything incompatible with our minimum supported version (3.8).Additional Context and Relevant Issues
Test Steps