Skip to content

Commit edaa002

Browse files
committed
Update Ruff to 0.16.5
Pin the RustPython Ruff fork to the patch commit based on Ruff 0.16.5 and adapt compiler and AST integration to the updated APIs. Assisted-by: Codex:GPT-5
1 parent 43544a2 commit edaa002

20 files changed

Lines changed: 221 additions & 90 deletions

‎.github/workflows/ci.yaml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ jobs:
9797

9898
- uses: dtolnay/rust-toolchain@stable
9999

100+
- name: Use a short Cargo home on Windows
101+
if: runner.os == 'Windows'
102+
shell: pwsh
103+
run: |
104+
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
105+
git config --global core.longpaths true
106+
100107
- name: Restore cache
101108
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
102109
with:
@@ -105,6 +112,9 @@ jobs:
105112
~/.cargo/registry/index/
106113
~/.cargo/registry/cache/
107114
~/.cargo/git/db/
115+
${{ runner.temp }}/c/registry/index/
116+
${{ runner.temp }}/c/registry/cache/
117+
${{ runner.temp }}/c/git/db/
108118
target/
109119
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-
110120
restore-keys: |
@@ -338,6 +348,13 @@ jobs:
338348

339349
- uses: dtolnay/rust-toolchain@stable
340350

351+
- name: Use a short Cargo home on Windows
352+
if: runner.os == 'Windows'
353+
shell: pwsh
354+
run: |
355+
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
356+
git config --global core.longpaths true
357+
341358
- name: Restore cache
342359
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
343360
with:
@@ -346,6 +363,9 @@ jobs:
346363
~/.cargo/registry/index/
347364
~/.cargo/registry/cache/
348365
~/.cargo/git/db/
366+
${{ runner.temp }}/c/registry/index/
367+
${{ runner.temp }}/c/registry/cache/
368+
${{ runner.temp }}/c/git/db/
349369
target/
350370
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-
351371
restore-keys: |
@@ -499,6 +519,13 @@ jobs:
499519
with:
500520
components: clippy
501521

522+
- name: Use a short Cargo home on Windows
523+
if: runner.os == 'Windows'
524+
shell: pwsh
525+
run: |
526+
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
527+
git config --global core.longpaths true
528+
502529
- name: Restore cache
503530
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
504531
with:
@@ -507,6 +534,9 @@ jobs:
507534
~/.cargo/registry/index/
508535
~/.cargo/registry/cache/
509536
~/.cargo/git/db/
537+
${{ runner.temp }}/c/registry/index/
538+
${{ runner.temp }}/c/registry/cache/
539+
${{ runner.temp }}/c/git/db/
510540
target/
511541
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-
512542
restore-keys: |

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ jobs:
6060
with:
6161
target: ${{ matrix.target }}
6262

63+
- name: Use a short Cargo home on Windows
64+
if: runner.os == 'Windows'
65+
shell: pwsh
66+
run: |
67+
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
68+
git config --global core.longpaths true
69+
6370
- name: Install macOS dependencies
6471
uses: ./.github/actions/install-macos-deps
6572
with:

‎.github/workflows/update-caches.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ jobs:
5252
toolchain: ${{ matrix.toolchain }}
5353
target: ${{ matrix.target }}
5454

55+
- name: Use a short Cargo home on Windows
56+
if: runner.os == 'Windows'
57+
shell: pwsh
58+
run: |
59+
"CARGO_HOME=$env:RUNNER_TEMP\c" >> $env:GITHUB_ENV
60+
git config --global core.longpaths true
61+
5562
- name: Install macos dependencies
5663
uses: ./.github/actions/install-macos-deps
5764
with:
@@ -74,5 +81,8 @@ jobs:
7481
~/.cargo/registry/index/
7582
~/.cargo/registry/cache/
7683
~/.cargo/git/db/
84+
${{ runner.temp }}/c/registry/index/
85+
${{ runner.temp }}/c/registry/cache/
86+
${{ runner.temp }}/c/git/db/
7787
target/
7888
key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}-${{ github.sha }}

‎Cargo.lock‎

Lines changed: 64 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ rustpython-wtf8 = { path = "crates/wtf8", version = "0.5.0" }
184184
rustpython-doc = { path = "crates/doc", version = "0.5.0" }
185185

186186
# Use the RustPython Ruff fork for RustPython public `_ast` metadata.
187-
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
188-
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
189-
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
190-
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
187+
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", rev = "df59fe4c720b48a29fe8726a37e2ef06322096f8" }
188+
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", rev = "df59fe4c720b48a29fe8726a37e2ef06322096f8" }
189+
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", rev = "df59fe4c720b48a29fe8726a37e2ef06322096f8" }
190+
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", rev = "df59fe4c720b48a29fe8726a37e2ef06322096f8" }
191191

192192
der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
193193
phf = { version = "0.14.0", default-features = false, features = ["macros"]}

‎Lib/test/test_syntax.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@
14681468
Traceback (most recent call last):
14691469
SyntaxError: invalid syntax
14701470
1471-
>>> dict(x=34, x=1, y=2); x $ y # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
1471+
>>> dict(x=34, x=1, y=2); x $ y
14721472
Traceback (most recent call last):
14731473
SyntaxError: invalid syntax
14741474

‎Lib/test/test_tstring.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ def test_runtime_errors(self):
232232
with self.assertRaises(NameError):
233233
eval("t'Hello, {name}'")
234234

235-
@unittest.expectedFailure # TODO: RUSTPYTHON
236235
def test_literal_concatenation(self):
237236
# Test concatenation of t-string literals
238237
t = t"Hello, " t"world"

0 commit comments

Comments
 (0)