Update/regenerate various ruff_python_stdlib APIs#25273
Merged
Conversation
1e45548 to
fb8a44d
Compare
|
a4ef0fd to
a879468
Compare
charliermarsh
approved these changes
May 20, 2026
Member
charliermarsh
left a comment
There was a problem hiding this comment.
This is great! Much better than my #25251 change.
|
| Project | Old Time | New Time | Change |
|---|---|---|---|
pandas-stubs |
11.09s | 18.59s | +68% |
a879468 to
97ea2b6
Compare
97ea2b6 to
88d291a
Compare
AlexWaygood
commented
May 20, 2026
| # seemingly ignoring `Diff.__iter__`. Seems like maybe a bug, but | ||
| # pyright and mypy both do the same. | ||
| diff_lines = cast(list[str], list(diff)) | ||
| diff_lines = list(diff) |
Member
Author
There was a problem hiding this comment.
I can't really pretend I understand why this cast is no longer necessary with these changes, but then again, according to the TODO comment, we never really understood why it was previously necessary, so... ours not to reason why
thejchap
pushed a commit
to thejchap/ruff
that referenced
this pull request
May 23, 2026
## Summary 1. Manually update various functions in `crates/ruff_python_stdlib/src/builtins.rs` to reflect new APIs added in Python 3.15. 2. Manually remove the incorrect inclusion of `frozenset` from `is_immutable_non_generic_type` in `crates/ruff_python_stdlib/src/typing.rs`. `frozenset` is a generic type. 3. Manually add `frozendict` to `is_immutable_generic_type` and `is_immutable_return_type` in `crates/ruff_python_stdlib/src/typing.rs` 4. Manually updates to `scripts/generate_builtin_modules.py`: use uv to invoke Python rather than relying on many different Python versions all being on `PATH`, drop support for Python 3.7 from the script (it can't be installed using uv), and apply various other simplifications. 5. Regenerate `is_builtin_module` in `crates/ruff_python_stdlib/src/sys/builtin_modules.rs` following the changes made in (4). Note that switching to uv-managed Python installs (PBS) appears to mean that quite a few more stdlib modules are recognised as being builtin modules, which is interesting. I also ran `scripts/generate_known_standard_library.py`, but it didn't make any changes to the Rust function generated by that script. ## Test Plan `cargo test`
anishgirianish
pushed a commit
to anishgirianish/ruff
that referenced
this pull request
May 28, 2026
## Summary 1. Manually update various functions in `crates/ruff_python_stdlib/src/builtins.rs` to reflect new APIs added in Python 3.15. 2. Manually remove the incorrect inclusion of `frozenset` from `is_immutable_non_generic_type` in `crates/ruff_python_stdlib/src/typing.rs`. `frozenset` is a generic type. 3. Manually add `frozendict` to `is_immutable_generic_type` and `is_immutable_return_type` in `crates/ruff_python_stdlib/src/typing.rs` 4. Manually updates to `scripts/generate_builtin_modules.py`: use uv to invoke Python rather than relying on many different Python versions all being on `PATH`, drop support for Python 3.7 from the script (it can't be installed using uv), and apply various other simplifications. 5. Regenerate `is_builtin_module` in `crates/ruff_python_stdlib/src/sys/builtin_modules.rs` following the changes made in (4). Note that switching to uv-managed Python installs (PBS) appears to mean that quite a few more stdlib modules are recognised as being builtin modules, which is interesting. I also ran `scripts/generate_known_standard_library.py`, but it didn't make any changes to the Rust function generated by that script. ## Test Plan `cargo test`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crates/ruff_python_stdlib/src/builtins.rsto reflect new APIs added in Python 3.15.frozensetfromis_immutable_non_generic_typeincrates/ruff_python_stdlib/src/typing.rs.frozensetis a generic type.frozendicttois_immutable_generic_typeandis_immutable_return_typeincrates/ruff_python_stdlib/src/typing.rsscripts/generate_builtin_modules.py: use uv to invoke Python rather than relying on many different Python versions all being onPATH, drop support for Python 3.7 from the script (it can't be installed using uv), and apply various other simplifications.is_builtin_moduleincrates/ruff_python_stdlib/src/sys/builtin_modules.rsfollowing the changes made in (4). Note that switching to uv-managed Python installs (PBS) appears to mean that quite a few more stdlib modules are recognised as being builtin modules, which is interesting.I also ran
scripts/generate_known_standard_library.py, but it didn't make any changes to the Rust function generated by that script.Test Plan
cargo test