Skip to content

Conversation

@UebelAndre
Copy link
Collaborator

This runs black, isort, mypy, and pylint on all python targets for PyO3 to keep tests and examples as clean and correct as possible.

Mypy notably tests the stub generation.

@UebelAndre UebelAndre marked this pull request as ready for review November 14, 2025 01:49
@UebelAndre UebelAndre enabled auto-merge November 14, 2025 01:49
- name: Compile requirements
if: runner.os == 'Windows'
run: |
bazel run "$env:TARGET" "--" "--upgrade" "--verbose"
Copy link
Collaborator

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}?

Comment on lines +55 to +74
[
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
]
Copy link
Collaborator

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:

Suggested change
[
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
]

Copy link
Collaborator Author

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 😅

@UebelAndre UebelAndre added this pull request to the merge queue Nov 14, 2025
Merged via the queue into bazelbuild:main with commit 11a35f7 Nov 15, 2025
3 checks passed
@UebelAndre UebelAndre deleted the pyo3 branch November 15, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants