Skip to content

Commit f02f39b

Browse files
committed
Merge branch 'main' into charlie/metaclass
* main: (131 commits) [ty] Fixup examples in `invalid-key` docs (#23968) [ty] Fix compiler warning about unused variable (#23967) [ty] Sync vendored typeshed stubs (#23963) Add a `.git-blame-ignore-revs` file (#23959) Revert "[ty] Completely remove the `NoReturn` shortcut optimization" (#23955) [ty] Completely remove the `NoReturn` shortcut optimization (#23378) [ty] Introduce fast path for protocol non-assignability (#23952) Bump typing conformance suite SHA (#23951) Minor followup to severity display - use preview function in server instead of checking preview disabled directly (#23950) Document editor features for markdown code formatting (#23924) [ty] Add `with_recursion_guard()` helpers to `relation.rs` (#23945) [ty] Remove `check_optional_method_pair` methods (#23947) [ty] Remove unused `CycleDetector::try_visit` method (#23944) [ty] Ensure TypedDict subscripts for unknown keys return Unknown (#23926) [ty] Fix variance of frozen dataclass-transform models (#23931) Display output severity in preview (#23845) Revert "[`ruff`] use `bitcode` instead of `bincode`" (#23935) Fix shell injection via `shell=True` in subprocess calls (#23894) [ty] Refactor `relation.rs` to store state on a struct rather than passing around 7 arguments every time we recurse (#23837) Don't return code actions for non-Python documents (#23905) ...
2 parents b752118 + 84b099f commit f02f39b

534 files changed

Lines changed: 29207 additions & 15248 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.

.git-blame-ignore-revs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Extract class and instance types
2+
320a3c68aebf3dd13f3496efa7ecc21f04c4f34a
3+
# Rename Red Knot
4+
b51c4f82ea6b6e40dcf3622dd009d463bb7e2247
5+
# Move module resolver code into its own crate
6+
b4c2825afdd8c1010c3a5859521629d2d1e0a6df
7+
# split up types/infer.rs
8+
c6b92b918e4d350e4f8aed95a41985f80ca7dfc9
9+
# Extract relation module from types.rs
10+
24dd149e0351b6c27abf8ac9896b9634d1daeb95
11+
# Move subscript logic out of builder.rs
12+
c20cb8fc39878be34c3f56dc9b1982e13dbf52ac
13+
# Move binary expression logic out of builder.rs
14+
63b7ee8accd87e1e6b9bf04218d352fd59d255bd
15+
# move comparison logic out of builder.rs
16+
d3b9e6000423608a20c3ac563f0e7441decea030
17+
# Move UnionType and IntersectionType to a new types::set_theoretic submodule
18+
347452f41f5abe651362e936255551a32f45419d
19+
# move KnownInstanceType, and related types, to a new known_instance.rs submodule
20+
d98b514a1c592797035bf09a424cc72ee78fa5b6
21+
# Introduce types::bool, types::context_manager and types::iteration
22+
48cf24d48bbf59fb8b236087e0966291a07674b9
23+
# Move method-related types to a submodule
24+
7750704dec4865958912876cbe4e9b4445def7f6
25+
# move Type::subtyping_is_always_reflexive to types::relation
26+
9e69010d91cf171d2c6ad1ac0655fa9da62420fc
27+
# Move CallableType, and related methods/types, to a new types::callable submodule
28+
04023a2a65ebcde99a3bc2f4d0644092581a65ba
29+
# Move TypeVar-related code to a new types::typevar submodule
30+
a9b2876bd33264c826aaf38e462632f1f7bceb55
31+
# Move tests and type-alias-related code out of types.rs
32+
38c273aa235aca9a4b2d9e229c9d596f9eab2c65
33+
# Split deferred checks out of types/infer/builder.rs
34+
4926bd58204839cb75a8ed1397e824bbc8f644ca
35+
# Split out more submodules from types/infer/builder.rs
36+
53ad26f1e10b749e1ef4680603aa9156dd528dc5
37+
# Split up types/class.rs
38+
34cee06dfa6c558c4ab1460200033ea44b368ae4

.github/mypy-primer-ty.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
# Enable off-by-default rules.
55
[rules]
6-
possibly-unresolved-reference = "warn"
7-
possibly-missing-import = "warn"
86
division-by-zero = "warn"
7+
possibly-missing-attribute = "warn"
8+
possibly-missing-import = "warn"
9+
possibly-unresolved-reference = "warn"
910
unsupported-dynamic-base = "warn"

.github/pr-assignee-pools.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ reviewers = ["amyreese", "ntBre"]
99
[[pools]]
1010
name = "ty-semantic"
1111
paths = ["/crates/ty_python_semantic/**"]
12-
reviewers = ["carljm", "dcreager", "ibraheemdev", "oconnor663"]
12+
reviewers = ["carljm", "sharkdp", "dcreager", "ibraheemdev", "oconnor663"]
1313

1414
[[pools]]
1515
name = "ty-module-resolver"

.github/workflows/build-binaries.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: "Prep README.md"
5050
run: python scripts/transform_readme.py --target pypi
5151
- name: "Build sdist"
52-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
52+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
5353
with:
5454
maturin-version: v1.11.5
5555
command: sdist
@@ -60,7 +60,7 @@ jobs:
6060
"${MODULE_NAME}" --help
6161
python -m "${MODULE_NAME}" --help
6262
- name: "Upload sdist"
63-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
63+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6464
with:
6565
name: wheels-sdist
6666
path: dist
@@ -80,13 +80,13 @@ jobs:
8080
- name: "Prep README.md"
8181
run: python scripts/transform_readme.py --target pypi
8282
- name: "Build wheels - x86_64"
83-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
83+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
8484
with:
8585
maturin-version: v1.11.5
8686
target: x86_64
8787
args: --release --locked --out dist --compatibility pypi
8888
- name: "Upload wheels"
89-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
89+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
9090
with:
9191
name: wheels-macos-x86_64
9292
path: dist
@@ -101,7 +101,7 @@ jobs:
101101
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
102102
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
103103
- name: "Upload binary"
104-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
104+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
105105
with:
106106
name: artifacts-macos-x86_64
107107
path: |
@@ -123,7 +123,7 @@ jobs:
123123
- name: "Prep README.md"
124124
run: python scripts/transform_readme.py --target pypi
125125
- name: "Build wheels - aarch64"
126-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
126+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
127127
with:
128128
maturin-version: v1.11.5
129129
target: aarch64
@@ -134,7 +134,7 @@ jobs:
134134
ruff --help
135135
python -m ruff --help
136136
- name: "Upload wheels"
137-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
137+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
138138
with:
139139
name: wheels-aarch64-apple-darwin
140140
path: dist
@@ -149,7 +149,7 @@ jobs:
149149
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
150150
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
151151
- name: "Upload binary"
152-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
152+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
153153
with:
154154
name: artifacts-aarch64-apple-darwin
155155
path: |
@@ -180,7 +180,7 @@ jobs:
180180
- name: "Prep README.md"
181181
run: python scripts/transform_readme.py --target pypi
182182
- name: "Build wheels"
183-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
183+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
184184
with:
185185
maturin-version: v1.11.5
186186
target: ${{ matrix.platform.target }}
@@ -196,7 +196,7 @@ jobs:
196196
"${MODULE_NAME}" --help
197197
python -m "${MODULE_NAME}" --help
198198
- name: "Upload wheels"
199-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
199+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
200200
with:
201201
name: wheels-${{ matrix.platform.target }}
202202
path: dist
@@ -207,7 +207,7 @@ jobs:
207207
7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/ruff.exe
208208
sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
209209
- name: "Upload binary"
210-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
210+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
211211
with:
212212
name: artifacts-${{ matrix.platform.target }}
213213
path: |
@@ -234,7 +234,7 @@ jobs:
234234
- name: "Prep README.md"
235235
run: python scripts/transform_readme.py --target pypi
236236
- name: "Build wheels"
237-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
237+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
238238
with:
239239
maturin-version: v1.11.5
240240
target: ${{ matrix.target }}
@@ -247,7 +247,7 @@ jobs:
247247
"${MODULE_NAME}" --help
248248
python -m "${MODULE_NAME}" --help
249249
- name: "Upload wheels"
250-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
250+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
251251
with:
252252
name: wheels-${{ matrix.target }}
253253
path: dist
@@ -265,7 +265,7 @@ jobs:
265265
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
266266
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
267267
- name: "Upload binary"
268-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
268+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
269269
with:
270270
name: artifacts-${{ matrix.target }}
271271
path: |
@@ -315,7 +315,7 @@ jobs:
315315
- name: "Prep README.md"
316316
run: python scripts/transform_readme.py --target pypi
317317
- name: "Build wheels"
318-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
318+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
319319
with:
320320
maturin-version: v1.11.5
321321
target: ${{ matrix.platform.target }}
@@ -337,7 +337,7 @@ jobs:
337337
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
338338
ruff --help
339339
- name: "Upload wheels"
340-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
340+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
341341
with:
342342
name: wheels-${{ matrix.platform.target }}
343343
path: dist
@@ -355,7 +355,7 @@ jobs:
355355
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
356356
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
357357
- name: "Upload binary"
358-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
358+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
359359
with:
360360
name: artifacts-${{ matrix.platform.target }}
361361
path: |
@@ -382,7 +382,7 @@ jobs:
382382
- name: "Prep README.md"
383383
run: python scripts/transform_readme.py --target pypi
384384
- name: "Build wheels"
385-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
385+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
386386
with:
387387
maturin-version: v1.11.5
388388
target: ${{ matrix.target }}
@@ -398,7 +398,7 @@ jobs:
398398
.venv/bin/${MODULE_NAME} --help;
399399
"
400400
- name: "Upload wheels"
401-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
401+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
402402
with:
403403
name: wheels-${{ matrix.target }}
404404
path: dist
@@ -416,7 +416,7 @@ jobs:
416416
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
417417
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
418418
- name: "Upload binary"
419-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
419+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
420420
with:
421421
name: artifacts-${{ matrix.target }}
422422
path: |
@@ -446,7 +446,7 @@ jobs:
446446
- name: "Prep README.md"
447447
run: python scripts/transform_readme.py --target pypi
448448
- name: "Build wheels"
449-
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
449+
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
450450
with:
451451
maturin-version: v1.11.5
452452
target: ${{ matrix.platform.target }}
@@ -466,7 +466,7 @@ jobs:
466466
.venv/bin/pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
467467
.venv/bin/${{ env.MODULE_NAME }} --help
468468
- name: "Upload wheels"
469-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
469+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
470470
with:
471471
name: wheels-${{ matrix.platform.target }}
472472
path: dist
@@ -484,7 +484,7 @@ jobs:
484484
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
485485
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
486486
- name: "Upload binary"
487-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
487+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
488488
with:
489489
name: artifacts-${{ matrix.platform.target }}
490490
path: |

.github/workflows/build-docker.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
touch "/tmp/digests/${digest#sha256:}"
103103
104104
- name: Upload digests
105-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
105+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
106106
with:
107107
name: digests-${{ env.PLATFORM_TUPLE }}
108108
path: /tmp/digests/*
@@ -123,7 +123,7 @@ jobs:
123123
packages: write
124124
steps:
125125
- name: Download digests
126-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
126+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
127127
with:
128128
path: /tmp/digests
129129
pattern: digests-*
@@ -174,7 +174,7 @@ jobs:
174174
echo "digest=${digest}" >> "$GITHUB_OUTPUT"
175175
176176
- name: Generate artifact attestation
177-
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
177+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
178178
with:
179179
subject-name: ${{ env.RUFF_BASE_IMG }}
180180
subject-digest: ${{ steps.manifest-digest.outputs.digest }}
@@ -279,7 +279,7 @@ jobs:
279279
annotations: ${{ steps.meta.outputs.annotations }}
280280

281281
- name: Generate artifact attestation
282-
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
282+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
283283
with:
284284
subject-name: ${{ env.RUFF_BASE_IMG }}
285285
subject-digest: ${{ steps.build-and-push.outputs.digest }}
@@ -301,7 +301,7 @@ jobs:
301301
packages: write
302302
steps:
303303
- name: Download digests
304-
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
304+
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
305305
with:
306306
path: /tmp/digests
307307
pattern: digests-*
@@ -358,7 +358,7 @@ jobs:
358358
echo "digest=${digest}" >> "$GITHUB_OUTPUT"
359359
360360
- name: Generate artifact attestation
361-
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
361+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
362362
with:
363363
subject-name: ${{ env.RUFF_BASE_IMG }}
364364
subject-digest: ${{ steps.manifest-digest.outputs.digest }}

.github/workflows/build-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
mv /tmp/package.json crates/ruff_wasm/pkg
5353
- run: cp LICENSE crates/ruff_wasm/pkg # wasm-pack does not put the LICENSE file in the pkg
5454
- name: "Upload wasm artifact"
55-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
55+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
5656
with:
5757
# Avoid prefixing the name with `artifacts-` here to exclude it from the GitHub release.
5858
name: wasm-npm-${{ matrix.target }}

0 commit comments

Comments
 (0)