Rework typeshed-sync workflow to also add docstrings for Windows- and MacOS-specific APIs#19360
Merged
AlexWaygood merged 2 commits intomainfrom Jul 15, 2025
Merged
Rework typeshed-sync workflow to also add docstrings for Windows- and MacOS-specific APIs#19360AlexWaygood merged 2 commits intomainfrom
AlexWaygood merged 2 commits intomainfrom
Conversation
Contributor
|
MichaReiser
reviewed
Jul 15, 2025
MichaReiser
approved these changes
Jul 15, 2025
Member
There was a problem hiding this comment.
The git thingy where you make commits to carry over the docstrings is a bit hard to understand. I think using something like the upload files action might have been slightly easier. But I don't think it's worth changing, but some documentation at the top (e.g. take the PR summary) would be great
- name: Upload generated files
uses: actions/upload-artifact@v4
with:
name: files-${{ matrix.os }}
path: |
path/to/generated/files/
!path/to/exclude/
retention-days: 1
Don't dare to break the typeshed sync and then be off for a week ;)
168a845 to
584aa70
Compare
Member
Member
Author
|
Hmm, I'll try that on #19367 |
UnboundVariable
pushed a commit
to UnboundVariable/ruff
that referenced
this pull request
Jul 15, 2025
…finition * 'main' of https://github.com/astral-sh/ruff: (39 commits) [ty] Sync vendored typeshed stubs (astral-sh#19368) Fix typeshed-sync workflow (astral-sh#19367) Rework typeshed-sync workflow to also add docstrings for Windows- and MacOS-specific APIs (astral-sh#19360) [ty] Allow `-qq` for silent output mode (astral-sh#19366) [ty] Allow `-q` short alias for `--quiet` (astral-sh#19364) Add shellcheck to pre-commit (astral-sh#19361) distinguish references from definitions in `infer_nonlocal` [`pycodestyle`] Handle brace escapes for t-strings in logical lines (astral-sh#19358) [ty] Combine CallArguments and CallArgumentTypes (astral-sh#19337) Move Pylint rendering to `ruff_db` (astral-sh#19340) [`pylint`] Extend invalid string character rules to include t-strings (astral-sh#19355) Make TC010 docs example more realistic (astral-sh#19356) Move RDJSON rendering to `ruff_db` (astral-sh#19293) [`flake8-use-pathlib`] Skip single dots for `invalid-pathlib-with-suffix` (`PTH210`) on versions >= 3.14 (astral-sh#19331) [`ruff`] Allow `strict` kwarg when checking for `starmap-zip` (`RUF058`) in Python 3.14+ (astral-sh#19333) [ty] Reduce false positives for `TypedDict` types (astral-sh#19354) [ty] Remove `ConnectionInitializer` (astral-sh#19353) [ty] Use `Type::string_literal()` more (astral-sh#19352) [ty] Add ecosystem-report workflow (astral-sh#19349) [ty] Make use of salsa `Lookup` when interning values (astral-sh#19347) ... # Conflicts: # crates/ty_ide/src/goto.rs # crates/ty_server/src/server.rs
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
The docstring-adder codemod can only add docstrings for APIs that exist at runtime. I.e., if the codemod is run on a Linux machine, it can't add any docstrings for APIs that don't exist at runtime on a Linux machine. The Python stdlib has some APIs that only exist on Windows/MacOS, and it seems a shame not to provide docstrings for those too.
This PR reworks the
sync_typeshed.yamlworkflow so that:a. Syncs the typeshed stubs
b. Syncs the docstrings available on Linux
c. Commits the changes and pushes them to an upstream branch
a. Checks out the branch created by the Linux worker
b. Syncs all docstrings available on Windows that are not available on Linux
c. Commits the changes and pushes them to the same upstream branch
a. Checks out the branch created by the Linux worker
b. Syncs all docstrings available on MacOS that are not available on Linux or Windows
c. Commits the changes and pushes them to the same upstream branch
d. Creates the typeshed-sync PR
This PR also updates the pinned commit of docstring-adder to astral-sh/docstring-adder@7f350b0, which includes astral-sh/docstring-adder#2
Test Plan
¯\_(ツ)_/¯I ran pre-commit, and ran the new
codemod_docstrings.shscript through shellcheck. Not sure how else to test this other than by merging it and seeing if it works?