Skip to content

Commit 7247fb8

Browse files
committed
Merge branch 'main' into claude/fix-issue-1858-UjARA
* main: (149 commits) Preserve required parentheses in lambda bodies (#22747) [`flake8-simplify`] Make fix unsafe if it deletes comments (`SIM911`) (#22661) [`refurb`] Make fix unsafe if it deletes comments (`FURB145`) (#22670) [`ruff`] Make fix unsafe if it deletes comments (`RUF020`) (#22664) [ty] Add README for `ty_completion_bench` CLI tool [ty] Update completion eval [ty] Collect completions into a max-heap [ty] Truncate imports and qualifications derived from completions [ty] Get rid of high-level completion deduplication [ty] Refactor how we sort completions [ty] Optimize collection of "all symbols" [ty] Speed up completions by tweaking sorts [ty] Add new `ty_completion_bench` for ad hoc benchmarking gitignore: ignore scratch directories in completion eval truth directory [`pyupgrade`] Allow shadowing non-builtin bindings (`UP029`) (#22749) [ty] Emit invalid type form for stringified annotations (#22752) [ty] Allow `if type(x) is Y` narrowing for types other than class-literal types (#22729) [ty] Add basic support for overloads in `ParamSpec` (#21946) [`ruff`] Make fix unsafe if it deletes comments (`RUF019`) (#22663) [`flake8-bugbear`] Make fix unsafe if it deletes comments (`B014`) (#22659) ...
2 parents 110ae7c + 5c44152 commit 7247fb8

326 files changed

Lines changed: 16417 additions & 4472 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-binaries.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: "Build sdist"
5252
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
5353
with:
54-
maturin-version: v1.9.6
54+
maturin-version: v1.11.5
5555
command: sdist
5656
args: --out dist
5757
- name: "Test sdist"
@@ -82,9 +82,9 @@ jobs:
8282
- name: "Build wheels - x86_64"
8383
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
8484
with:
85-
maturin-version: v1.9.6
85+
maturin-version: v1.11.5
8686
target: x86_64
87-
args: --release --locked --out dist
87+
args: --release --locked --out dist --compatibility pypi
8888
- name: "Upload wheels"
8989
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
9090
with:
@@ -125,9 +125,9 @@ jobs:
125125
- name: "Build wheels - aarch64"
126126
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
127127
with:
128-
maturin-version: v1.9.6
128+
maturin-version: v1.11.5
129129
target: aarch64
130-
args: --release --locked --out dist
130+
args: --release --locked --out dist --compatibility pypi
131131
- name: "Test wheel - aarch64"
132132
run: |
133133
pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall
@@ -182,9 +182,9 @@ jobs:
182182
- name: "Build wheels"
183183
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
184184
with:
185-
maturin-version: v1.9.6
185+
maturin-version: v1.11.5
186186
target: ${{ matrix.platform.target }}
187-
args: --release --locked --out dist
187+
args: --release --locked --out dist --compatibility pypi
188188
env:
189189
# aarch64 build fails, see https://github.com/PyO3/maturin/issues/2110
190190
XWIN_VERSION: 16
@@ -236,10 +236,10 @@ jobs:
236236
- name: "Build wheels"
237237
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
238238
with:
239-
maturin-version: v1.9.6
239+
maturin-version: v1.11.5
240240
target: ${{ matrix.target }}
241-
manylinux: auto
242-
args: --release --locked --out dist
241+
manylinux: 2_17
242+
args: --release --locked --out dist --compatibility pypi
243243
- name: "Test wheel"
244244
if: ${{ startsWith(matrix.target, 'x86_64') }}
245245
run: |
@@ -280,25 +280,34 @@ jobs:
280280
platform:
281281
- target: aarch64-unknown-linux-gnu
282282
arch: aarch64
283+
manylinux: 2_17
283284
# see https://github.com/astral-sh/ruff/issues/3791
284285
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
285286
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
286287
- target: armv7-unknown-linux-gnueabihf
287288
arch: armv7
289+
manylinux: 2_17
288290
- target: s390x-unknown-linux-gnu
289291
arch: s390x
292+
manylinux: 2_17
290293
- target: powerpc64le-unknown-linux-gnu
291294
arch: ppc64le
295+
manylinux: 2_17
292296
# see https://github.com/astral-sh/ruff/issues/10073
293297
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
294298
- target: powerpc64-unknown-linux-gnu
295299
arch: ppc64
300+
manylinux: 2_17
296301
# see https://github.com/astral-sh/ruff/issues/10073
297302
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
298303
- target: arm-unknown-linux-musleabihf
304+
# Use the cross container, but tag as `linux_armv6l`
305+
manylinux: auto
299306
arch: arm
300307
- target: riscv64gc-unknown-linux-gnu
301308
arch: riscv64
309+
# Minimum manylinux target for riscv64
310+
manylinux: 2_31
302311

303312
steps:
304313
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -313,11 +322,11 @@ jobs:
313322
- name: "Build wheels"
314323
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
315324
with:
316-
maturin-version: v1.9.6
325+
maturin-version: v1.11.5
317326
target: ${{ matrix.platform.target }}
318-
manylinux: auto
327+
manylinux: ${{ matrix.platform.manylinux }}
319328
docker-options: ${{ matrix.platform.maturin_docker_options }}
320-
args: --release --locked --out dist
329+
args: --release --locked --out dist --compatibility pypi
321330
- uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1
322331
if: ${{ matrix.platform.arch != 'ppc64' && matrix.platform.arch != 'ppc64le'}}
323332
name: Test wheel
@@ -380,10 +389,10 @@ jobs:
380389
- name: "Build wheels"
381390
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
382391
with:
383-
maturin-version: v1.9.6
392+
maturin-version: v1.11.5
384393
target: ${{ matrix.target }}
385394
manylinux: musllinux_1_2
386-
args: --release --locked --out dist
395+
args: --release --locked --out dist --compatibility pypi
387396
- name: "Test wheel"
388397
if: matrix.target == 'x86_64-unknown-linux-musl'
389398
uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 # v3
@@ -446,10 +455,10 @@ jobs:
446455
- name: "Build wheels"
447456
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
448457
with:
449-
maturin-version: v1.9.6
458+
maturin-version: v1.11.5
450459
target: ${{ matrix.platform.target }}
451460
manylinux: musllinux_1_2
452-
args: --release --locked --out dist
461+
args: --release --locked --out dist --compatibility pypi
453462
docker-options: ${{ matrix.platform.maturin_docker_options }}
454463
- uses: uraimo/run-on-arch-action@d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1
455464
name: Test wheel

.github/workflows/ci.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ jobs:
281281
- name: "Install mold"
282282
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
283283
- name: "Install cargo nextest"
284-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
284+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
285285
with:
286286
tool: cargo-nextest
287287
- name: "Install cargo insta"
288-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
288+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
289289
with:
290290
tool: cargo-insta
291291
- name: "Install uv"
@@ -343,7 +343,7 @@ jobs:
343343
- name: "Install mold"
344344
uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
345345
- name: "Install cargo nextest"
346-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
346+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
347347
with:
348348
tool: cargo-nextest
349349
- name: "Install uv"
@@ -376,7 +376,7 @@ jobs:
376376
- name: "Install Rust toolchain"
377377
run: rustup show
378378
- name: "Install cargo nextest"
379-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
379+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
380380
with:
381381
tool: cargo-nextest
382382
- name: "Install uv"
@@ -969,7 +969,7 @@ jobs:
969969
run: rustup show
970970

971971
- name: "Install codspeed"
972-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
972+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
973973
with:
974974
tool: cargo-codspeed
975975

@@ -1008,7 +1008,7 @@ jobs:
10081008
run: rustup show
10091009

10101010
- name: "Install codspeed"
1011-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
1011+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
10121012
with:
10131013
tool: cargo-codspeed
10141014

@@ -1044,7 +1044,7 @@ jobs:
10441044
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
10451045

10461046
- name: "Install codspeed"
1047-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
1047+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
10481048
with:
10491049
tool: cargo-codspeed
10501050

@@ -1095,7 +1095,7 @@ jobs:
10951095
run: rustup show
10961096

10971097
- name: "Install codspeed"
1098-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
1098+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
10991099
with:
11001100
tool: cargo-codspeed
11011101

@@ -1133,7 +1133,7 @@ jobs:
11331133
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
11341134

11351135
- name: "Install codspeed"
1136-
uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2.65.13
1136+
uses: taiki-e/install-action@3522286d40783523f9c7880e33f785905b4c20d0 # v2.66.1
11371137
with:
11381138
tool: cargo-codspeed
11391139

.github/workflows/publish-wasm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
registry-url: "https://registry.npmjs.org"
3333
- name: "Publish (dry-run)"
3434
if: ${{ inputs.plan == '' || fromJson(inputs.plan).announcement_tag_is_implicit }}
35-
run: npm publish --dry-run pkg
35+
run: npm publish --dry-run pkg/
3636
- name: "Publish"
3737
if: ${{ inputs.plan != '' && !fromJson(inputs.plan).announcement_tag_is_implicit }}
38-
run: npm publish --provenance --access public pkg
38+
run: npm publish --provenance --access public pkg/
3939
env:
4040
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/typing_conformance.yaml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- "crates/ruff_db"
1515
- "crates/ruff_python_ast"
1616
- "crates/ruff_python_parser"
17+
- "scripts/conformance.py"
1718
- ".github/workflows/typing_conformance.yaml"
1819
- ".github/workflows/typing_conformance_comment.yaml"
1920
- "Cargo.lock"
@@ -29,7 +30,8 @@ env:
2930
CARGO_TERM_COLOR: always
3031
RUSTUP_MAX_RETRIES: 10
3132
RUST_BACKTRACE: 1
32-
CONFORMANCE_SUITE_COMMIT: 9f6d8ced7cd1c8d92687a4e9c96d7716452e471e
33+
CONFORMANCE_SUITE_COMMIT: dece44f2922ca390fe314145d09939514a21e76e
34+
PYTHON_VERSION: 3.12
3335

3436
jobs:
3537
typing_conformance:
@@ -54,14 +56,16 @@ jobs:
5456
with:
5557
workspaces: "ruff"
5658

59+
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
60+
with:
61+
python-version: ${{ env.PYTHON_VERSION }}
62+
5763
- name: Install Rust toolchain
5864
run: rustup show
5965

6066
- name: Compute diagnostic diff
6167
shell: bash
6268
run: |
63-
RUFF_DIR="$GITHUB_WORKSPACE/ruff"
64-
6569
# Build the executable for the old and new commit
6670
(
6771
cd ruff
@@ -80,36 +84,22 @@ jobs:
8084
)
8185
8286
(
83-
cd typing/conformance/tests
84-
85-
echo "Running ty on old commit (merge base)"
86-
"$RUFF_DIR/ty-old" check --color=never --output-format=concise . > "$GITHUB_WORKSPACE/old-output.txt" 2>&1 || true
87-
88-
echo "Running ty on new commit"
89-
"$RUFF_DIR/ty-new" check --color=never --output-format=concise . > "$GITHUB_WORKSPACE/new-output.txt" 2>&1 || true
87+
echo "Creating comment with conformance comparison"
88+
cd ruff
89+
git switch - --detach
90+
91+
python "./scripts/conformance.py" \
92+
--old-ty "./ty-old" \
93+
--new-ty "./ty-new" \
94+
--tests-path "${GITHUB_WORKSPACE}/typing/conformance/" \
95+
--python-version "$PYTHON_VERSION" \
96+
--output ../typing_conformance_diagnostics.diff
9097
)
9198
92-
if ! diff -u old-output.txt new-output.txt > typing_conformance_diagnostics.diff; then
93-
echo "Differences found between base and PR"
94-
else
95-
echo "No differences found"
96-
touch typing_conformance_diagnostics.diff
97-
fi
98-
99-
echo "${CONFORMANCE_SUITE_COMMIT}" > conformance-suite-commit
100-
10199
# NOTE: astral-sh-bot uses this artifact to post comments on PRs.
102100
# Make sure to update the bot if you rename the artifact.
103101
- name: Upload diff
104102
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
105103
with:
106104
name: typing_conformance_diagnostics_diff
107105
path: typing_conformance_diagnostics.diff
108-
109-
# NOTE: astral-sh-bot uses this artifact to post comments on PRs.
110-
# Make sure to update the bot if you rename the artifact.
111-
- name: Upload conformance suite commit
112-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
113-
with:
114-
name: conformance-suite-commit
115-
path: conformance-suite-commit

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repos:
3535
priority: 0
3636

3737
- repo: https://github.com/crate-ci/typos
38-
rev: v1.41.0
38+
rev: v1.42.0
3939
hooks:
4040
- id: typos
4141
priority: 0
@@ -60,7 +60,7 @@ repos:
6060
# zizmor detects security vulnerabilities in GitHub Actions workflows.
6161
# Additional configuration for the tool is found in `.github/zizmor.yml`
6262
- repo: https://github.com/zizmorcore/zizmor-pre-commit
63-
rev: v1.19.0
63+
rev: v1.20.0
6464
hooks:
6565
- id: zizmor
6666
priority: 0
@@ -83,7 +83,7 @@ repos:
8383
- id: mdformat
8484
language: python # means renovate will also update `additional_dependencies`
8585
additional_dependencies:
86-
- mdformat-mkdocs==5.0.0
86+
- mdformat-mkdocs==5.1.3
8787
- mdformat-footnote==0.1.2
8888
exclude: |
8989
(?x)^(
@@ -93,7 +93,7 @@ repos:
9393
priority: 0
9494

9595
- repo: https://github.com/astral-sh/ruff-pre-commit
96-
rev: v0.14.10
96+
rev: v0.14.11
9797
hooks:
9898
- id: ruff-format
9999
priority: 0

0 commit comments

Comments
 (0)