mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
[red-knot] Typeshed patching: use build.rs instead of workflow (#15370)
## Summary The symlink-approach in the typeshed-sync workflow caused some problems on Windows, even though it seemed to work fine in CI: https://github.com/astral-sh/ruff/pull/15138#issuecomment-2578642129 Here, we rely on `build.rs` to patch typeshed instead, which allows us to get rid of the modifications in the workflow (thank you @MichaReiser for the idea). ## Test Plan - Made sure that changes to `knot_extensions.pyi` result in a recompile of `red_knot_vendored`.
This commit is contained in:
4
.github/workflows/sync_typeshed.yaml
vendored
4
.github/workflows/sync_typeshed.yaml
vendored
@@ -46,10 +46,6 @@ jobs:
|
||||
cp -r typeshed/stdlib ruff/crates/red_knot_vendored/vendor/typeshed/stdlib
|
||||
rm -rf ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/@tests
|
||||
git -C typeshed rev-parse HEAD > ruff/crates/red_knot_vendored/vendor/typeshed/source_commit.txt
|
||||
# Patch the typeshed stubs to include `knot_extensions`
|
||||
ln -s ../../../knot_extensions/knot_extensions.pyi ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/
|
||||
echo "# Patch applied for red_knot:" >> ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/VERSIONS
|
||||
echo "knot_extensions: 3.0-" >> ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/VERSIONS
|
||||
- name: Commit the changes
|
||||
id: commit
|
||||
if: ${{ steps.sync.outcome == 'success' }}
|
||||
|
||||
Reference in New Issue
Block a user