-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
CI: Run flake8 (plus various plugins) during tests #111
Conversation
How do you run these tests in a Windows environment? |
Additionally, I am strongly against a linter as a dev requirement. |
@pathunstrom The commands moved from being in |
Could you provide a rationale? |
I guess last quest, you mention mutable defaults, but I don't see any such changes in the code, am I missing them? |
@pathunstrom I found 2 at a quick glance, can't recall offhand if there were more. |
Based on discord discussion, let's break this up. I'm willing to accept all of the source changes made by the formatting in a PR. I don't disagree with any of it. However, we need to have further discussions on the tooling changes. I think that What needs further discussion is what the exact lint ruleset should be. |
Can this either happen in a follow-up PR or can one of you commit it to this branch? |
I think we ought to iterate as false-positives come up? |
I just rebased so CI would rerun with the fix from #112 |
c6e2afa
to
40a0269
Compare
The latest commit (40a0269) fixed the PyPy build: |
It's been almost a month, and there's been no discussion, and no response to my comments. |
The CI issue seems to be the same issue #112 should have fixed :( |
Confirmed: we have |
This should mitigate pip's inability to deal with [versionned dependencies], and will hopefully stop it from continuously breaking CI. [versionned dependencies]: ppb#111 (comment)
OK, looks like #114 fixed the CI issue (hopefully for good...) |
Ping? |
@astronouth7303 @pathunstrom I did what I suggested and split off the actual changes into #116. |
Rebased to solve the merge conflict, and fixed the lints that broke (because I can't write correctly-styled Python unassisted). |
So, about that discussion on which lint rules are desirable, you said it's needed but all we got is me monologuing for a month-and-a-half. What will it take to make it happen? |
Looks like hypothesis might have found a bug? Care to investigate? |
@astronouth7303 Was the failure you mentioned one of the things that we fixed recently? |
I can't find the CI that's in reference to, so I have no idea. |
This is useful to catch simple mistakes, unused variables or imports, ...
Rebased again, to deal with merge conflicts. |
Just going for it. bors r+ |
111: CI: Run flake8 (plus various plugins) during tests r=astronouth7303 a=nbraud - Superset of #116 : - [x] Extract tests & QA tools execution to a `tests.sh` script. - [x] Reorder execution order to fail faster. - [x] Eliminate mutable default parameters (found by `flake8-bugbear`) - [x] Uniformize the ordeer of `import` lines. - [x] Uniformize the use of trailing commas - Automatically enforce the things that were fixed in #116 : - [x] Check basic lints with `flake8` - [x] Check for PEP 8 [naming conventions](https://www.python.org/dev/peps/pep-0008/#naming-conventions) This caught an issue that should have been fixed in #85 (a scalar named `l`); this likely happened because the test in question was added concurrently to #85. - [x] Enable `flake8-bugbear` and its “opinionated” checks This caught a number of instances where mutable data was used in default parameters. - [x] Check for trailing commas where useful - [x] Enforce a consistent import order [PEP 8]: https://www.python.org/dev/peps/pep-0008/ [`black`]: https://github.com/ambv/black Co-authored-by: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
Build failed
|
@astronouth7303 I fixed the lint issues that got introduced into |
ppb_vector/vector2.py
Outdated
@@ -487,7 +487,7 @@ def truncate(self: Vector, max_length: typing.SupportsFloat) -> Vector: | |||
|
|||
Note that :py:meth:`vector.scale(max_length) <scale>` is equivalent to | |||
:py:meth:`vector.truncate(max_length) <truncate>` when | |||
:py:meth:`max_length \< vector.length <length>`. | |||
:py:meth:`max_length < vector.length <length>`. |
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 doesn't render right in Sphinx.
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.
Ohno. I thought I would dodge the issue by using a unicode <
sign, rather than the angled braket ;_;
Fixed with a different symbol O:3
NERD. bors r+ |
111: CI: Run flake8 (plus various plugins) during tests r=astronouth7303 a=nbraud - Superset of #116 : - [x] Extract tests & QA tools execution to a `tests.sh` script. - [x] Reorder execution order to fail faster. - [x] Eliminate mutable default parameters (found by `flake8-bugbear`) - [x] Uniformize the ordeer of `import` lines. - [x] Uniformize the use of trailing commas - Automatically enforce the things that were fixed in #116 : - [x] Check basic lints with `flake8` - [x] Check for PEP 8 [naming conventions](https://www.python.org/dev/peps/pep-0008/#naming-conventions) This caught an issue that should have been fixed in #85 (a scalar named `l`); this likely happened because the test in question was added concurrently to #85. - [x] Enable `flake8-bugbear` and its “opinionated” checks This caught a number of instances where mutable data was used in default parameters. - [x] Check for trailing commas where useful - [x] Enforce a consistent import order [PEP 8]: https://www.python.org/dev/peps/pep-0008/ [`black`]: https://github.com/ambv/black Co-authored-by: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
Build succeeded
|
@astronouth7303 Guilty as charged <3 |
On one hand, ≨ is a bit of an arcane rune, OTOH I like that it's extra explicit about |
Superset of Support running tests locally, fix various warts #116 :
tests.sh
script.flake8-bugbear
)import
lines.Automatically enforce the things that were fixed in Support running tests locally, fix various warts #116 :
flake8
This caught an issue that should have been fixed in tests: Clarify the property-based tests #85 (a scalar named
l
); this likely happened because the test in question was added concurrently to tests: Clarify the property-based tests #85.flake8-bugbear
and its “opinionated” checksThis caught a number of instances where mutable data was used in default parameters.