Skip to content

Commit 4dec44a

Browse files
authored
[ty] bump docstring-adder pin (astral-sh#19458)
1 parent b6579ea commit 4dec44a

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

.github/workflows/sync_typeshed.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ env:
3434
# and which all three workers push to.
3535
UPSTREAM_BRANCH: typeshedbot/sync-typeshed
3636

37+
# The path to the directory that contains the vendored typeshed stubs,
38+
# relative to the root of the Ruff repository.
39+
VENDORED_TYPESHED: crates/ty_vendored/vendor/typeshed
40+
3741
jobs:
3842
# Sync typeshed stubs, and sync all docstrings available on Linux.
3943
# Push the changes to a new branch on the upstream repository.
@@ -64,20 +68,20 @@ jobs:
6468
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
6569
- name: Sync typeshed stubs
6670
run: |
67-
rm -rf ruff/crates/ty_vendored/vendor/typeshed
68-
mkdir ruff/crates/ty_vendored/vendor/typeshed
69-
cp typeshed/README.md ruff/crates/ty_vendored/vendor/typeshed
70-
cp typeshed/LICENSE ruff/crates/ty_vendored/vendor/typeshed
71+
rm -rf "ruff/${VENDORED_TYPESHED}"
72+
mkdir "ruff/${VENDORED_TYPESHED}"
73+
cp typeshed/README.md "ruff/${VENDORED_TYPESHED}"
74+
cp typeshed/LICENSE "ruff/${VENDORED_TYPESHED}"
7175
7276
# The pyproject.toml file is needed by a later job for the black configuration.
7377
# It's deleted before creating the PR.
74-
cp typeshed/pyproject.toml ruff/crates/ty_vendored/vendor/typeshed
78+
cp typeshed/pyproject.toml "ruff/${VENDORED_TYPESHED}"
7579
76-
cp -r typeshed/stdlib ruff/crates/ty_vendored/vendor/typeshed/stdlib
77-
rm -rf ruff/crates/ty_vendored/vendor/typeshed/stdlib/@tests
78-
git -C typeshed rev-parse HEAD > ruff/crates/ty_vendored/vendor/typeshed/source_commit.txt
80+
cp -r typeshed/stdlib "ruff/${VENDORED_TYPESHED}/stdlib"
81+
rm -rf "ruff/${VENDORED_TYPESHED}/stdlib/@tests"
82+
git -C typeshed rev-parse HEAD > "ruff/${VENDORED_TYPESHED}/source_commit.txt"
7983
cd ruff
80-
git checkout -b typeshedbot/sync-typeshed
84+
git checkout -b "${UPSTREAM_BRANCH}"
8185
git add .
8286
git commit -m "Sync typeshed. Source commit: https://github.com/python/typeshed/commit/$(git -C ../typeshed rev-parse HEAD)" --allow-empty
8387
- name: Sync Linux docstrings
@@ -167,17 +171,17 @@ jobs:
167171
# consistent with the other typeshed stubs around them.
168172
# Typeshed formats code using black in their CI, so we just invoke
169173
# black on the stubs the same way that typeshed does.
170-
uvx black crates/ty_vendored/vendor/typeshed/stdlib --config crates/ty_vendored/vendor/typeshed/pyproject.toml || true
174+
uvx black "${VENDORED_TYPESHED}/stdlib" --config "${VENDORED_TYPESHED}/pyproject.toml" || true
171175
git commit -am "Format codemodded docstrings" --allow-empty
172176
173-
rm crates/ty_vendored/vendor/typeshed/pyproject.toml
177+
rm "${VENDORED_TYPESHED}/pyproject.toml"
174178
git commit -am "Remove pyproject.toml file"
175179
176180
git push
177181
- name: Create a PR
178182
if: ${{ success() }}
179183
run: |
180-
gh pr list --repo "$GITHUB_REPOSITORY" --head typeshedbot/sync-typeshed --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
184+
gh pr list --repo "${GITHUB_REPOSITORY}" --head "${UPSTREAM_BRANCH}" --json id --jq length | grep 1 && exit 0 # exit if there is existing pr
181185
gh pr create --title "[ty] Sync vendored typeshed stubs" --body "Close and reopen this PR to trigger CI" --label "ty"
182186
183187
create-issue-on-failure:

scripts/codemod_docstrings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
set -eu
2020

21-
docstring_adder="git+https://github.com/astral-sh/docstring-adder.git@513b650c8c6b0f1bb6f12d8f79da9294614214e4"
21+
docstring_adder="git+https://github.com/astral-sh/docstring-adder.git@6e91640a011248f5d9f85ce98218e16d1c4277c4"
2222
stdlib_path="./crates/ty_vendored/vendor/typeshed/stdlib"
2323

2424
for python_version in 3.14 3.13 3.12 3.11 3.10 3.9

0 commit comments

Comments
 (0)