-
Notifications
You must be signed in to change notification settings - Fork 526
Added linters to pyo3 tests #3728
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
Conversation
| - name: Compile requirements | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| bazel run "$env:TARGET" "--" "--upgrade" "--verbose" |
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.
Where does $env:TARGET come from here? Is this meant to be ${TARGET}?
| [ | ||
| py_reqs_compiler( | ||
| name = "requirements.{}.update".format(platform), | ||
| requirements_in = "requirements.in", | ||
| requirements_txt = "requirements_{}.txt".format(platform), | ||
| target_compatible_with = select({ | ||
| ":{}".format(platform): [], | ||
| "//conditions:default": ["@platforms//:incompatible"], | ||
| }), | ||
| ) | ||
| for platform in PLATFORMS | ||
| ] | ||
|
|
||
| [ | ||
| py_reqs_solution_test( | ||
| name = "requirements_{}_test".format(platform), | ||
| compiler = ":requirements.{}.update".format(platform), | ||
| ) | ||
| for platform in PLATFORMS | ||
| ] |
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.
Completely optional, but I tend to combine these into a nested list to avoid needing to repeat the loop:
| [ | |
| py_reqs_compiler( | |
| name = "requirements.{}.update".format(platform), | |
| requirements_in = "requirements.in", | |
| requirements_txt = "requirements_{}.txt".format(platform), | |
| target_compatible_with = select({ | |
| ":{}".format(platform): [], | |
| "//conditions:default": ["@platforms//:incompatible"], | |
| }), | |
| ) | |
| for platform in PLATFORMS | |
| ] | |
| [ | |
| py_reqs_solution_test( | |
| name = "requirements_{}_test".format(platform), | |
| compiler = ":requirements.{}.update".format(platform), | |
| ) | |
| for platform in PLATFORMS | |
| ] | |
| [ | |
| [ | |
| py_reqs_compiler( | |
| name = "requirements.{}.update".format(platform), | |
| requirements_in = "requirements.in", | |
| requirements_txt = "requirements_{}.txt".format(platform), | |
| target_compatible_with = select({ | |
| ":{}".format(platform): [], | |
| "//conditions:default": ["@platforms//:incompatible"], | |
| }), | |
| ), | |
| py_reqs_solution_test( | |
| name = "requirements_{}_test".format(platform), | |
| compiler = ":requirements.{}.update".format(platform), | |
| ), | |
| ] | |
| for platform in PLATFORMS | |
| ] |
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.
Oh, I'd have done that if automerge didn't see it first 😅
This runs
black,isort,mypy, andpylinton all python targets forPyO3to keep tests and examples as clean and correct as possible.Mypy notably tests the stub generation.