Skip to content

Commit be595fb

Browse files
committed
Merge remote-tracking branch 'upstream/main' into update-ruff-0-15-0
2 parents de435d5 + f680f8a commit be595fb

Some content is hidden

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

89 files changed

+1470
-822
lines changed

.cspell.dict/cpython.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ NEWLOCALS
127127
newsemlockobject
128128
nfrees
129129
nkwargs
130-
nlocalsplus
131130
nkwelts
131+
nlocalsplus
132132
Nondescriptor
133133
noninteger
134134
nops
@@ -160,6 +160,7 @@ pylifecycle
160160
pymain
161161
pyrepl
162162
PYTHONTRACEMALLOC
163+
PYTHONUTF8
163164
pythonw
164165
PYTHREAD_NAME
165166
releasebuffer
@@ -171,9 +172,11 @@ saveall
171172
scls
172173
setdict
173174
setfunc
175+
setprofileallthreads
174176
SETREF
175177
setresult
176178
setslice
179+
settraceallthreads
177180
SLOTDEFINED
178181
SMALLBUF
179182
SOABI
@@ -190,8 +193,10 @@ subparams
190193
subscr
191194
sval
192195
swappedbytes
196+
sysdict
193197
templatelib
194198
testconsole
199+
threadstate
195200
ticketer
196201
tmptype
197202
tok_oldval

.cspell.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@
152152
"IFEXEC",
153153
// "stat"
154154
"FIRMLINK",
155-
// CPython internal names
156-
"PYTHONUTF",
157-
"sysdict",
158-
"settraceallthreads",
159-
"setprofileallthreads"
160155
],
161156
// flagWords - list of words to be always considered incorrect
162157
"flagWords": [
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This action installs a few dependencies necessary to build RustPython on macOS. By default it installs
2+
# autoconf, automake and libtool, but can be configured depending on which libraries are needed:
3+
#
4+
# ```
5+
# - uses: ./.github/actions/install-macos-deps
6+
# with:
7+
# openssl: true
8+
# libtool: false
9+
# ```
10+
#
11+
# See the `inputs` section for all options and their defaults. Note that you must checkout the
12+
# repository before you can use this action.
13+
#
14+
# This action will only install dependencies when the current operating system is macOS. It will do
15+
# nothing on any other OS (Linux, Windows).
16+
17+
name: Install macOS dependencies
18+
description: Installs the dependencies necessary to build RustPython on macOS.
19+
inputs:
20+
autoconf:
21+
description: Install autoconf (autoconf)
22+
required: false
23+
default: "true"
24+
automake:
25+
description: Install automake (automake)
26+
required: false
27+
default: "true"
28+
libtool:
29+
description: Install libtool (libtool)
30+
required: false
31+
default: "true"
32+
openssl:
33+
description: Install openssl (openssl@3)
34+
required: false
35+
default: "false"
36+
runs:
37+
using: composite
38+
steps:
39+
- name: Install macOS dependencies
40+
shell: bash
41+
if: ${{ runner.os == 'macOS' }}
42+
run: >
43+
brew install
44+
${{ fromJSON(inputs.autoconf) && 'autoconf' || '' }}
45+
${{ fromJSON(inputs.automake) && 'automake' || '' }}
46+
${{ fromJSON(inputs.libtool) && 'libtool' || '' }}
47+
${{ fromJSON(inputs.openssl) && 'openssl@3' || '' }}

.github/workflows/ci.yaml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,8 @@ jobs:
135135
components: clippy
136136
- uses: Swatinem/rust-cache@v2
137137

138-
- name: Set up the Mac environment
139-
run: brew install autoconf automake libtool
140-
if: runner.os == 'macOS'
138+
- name: Install macOS dependencies
139+
uses: ./.github/actions/install-macos-deps
141140

142141
- name: run clippy
143142
run: cargo clippy ${{ env.CARGO_ARGS }} --workspace --all-targets ${{ env.WORKSPACE_EXCLUDES }} -- -Dwarnings
@@ -263,13 +262,6 @@ jobs:
263262
- name: Check compilation for freebsd
264263
run: cargo check --target x86_64-unknown-freebsd ${{ env.CARGO_ARGS_NO_SSL }}
265264

266-
- uses: dtolnay/rust-toolchain@stable
267-
with:
268-
target: x86_64-unknown-freebsd
269-
270-
- name: Check compilation for freeBSD
271-
run: cargo check --target x86_64-unknown-freebsd ${{ env.CARGO_ARGS_NO_SSL }}
272-
273265
- uses: dtolnay/rust-toolchain@stable
274266
with:
275267
target: wasm32-wasip2
@@ -293,7 +285,10 @@ jobs:
293285
runs-on: ${{ matrix.os }}
294286
strategy:
295287
matrix:
296-
os: [macos-latest, ubuntu-latest, windows-2025]
288+
os:
289+
- macos-latest
290+
- ubuntu-latest
291+
- windows-2025
297292
fail-fast: false
298293
steps:
299294
- uses: actions/checkout@v6.0.2
@@ -302,18 +297,15 @@ jobs:
302297
- uses: actions/setup-python@v6.2.0
303298
with:
304299
python-version: ${{ env.PYTHON_VERSION }}
305-
- name: Set up the Mac environment
306-
run: brew install autoconf automake libtool openssl@3
307-
if: runner.os == 'macOS'
308-
- name: build rustpython
309-
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
310-
if: runner.os == 'macOS'
311-
- name: build rustpython
312-
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }},jit
313-
if: runner.os != 'macOS'
314-
- uses: actions/setup-python@v6.2.0
300+
301+
- name: Install macOS dependencies
302+
uses: ./.github/actions/install-macos-deps
315303
with:
316-
python-version: ${{ env.PYTHON_VERSION }}
304+
openssl: true
305+
306+
- name: build rustpython
307+
run: cargo build --release --verbose --features=threading,jit ${{ env.CARGO_ARGS }}
308+
317309
- name: run snippets
318310
run: python -m pip install -r requirements.txt && pytest -v
319311
working-directory: ./extra_tests
@@ -445,14 +437,10 @@ jobs:
445437
run: |
446438
target/release/rustpython -m venv testvenv
447439
testvenv/bin/rustpython -m pip install wheel
448-
- if: runner.os != 'macOS'
449-
name: Check whats_left is not broken
450-
shell: bash
451-
run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading,jit"
452-
- if: runner.os == 'macOS' # TODO fix jit on macOS
453-
name: Check whats_left is not broken (macOS)
440+
441+
- name: Check whats_left is not broken
454442
shell: bash
455-
run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading" # no jit on macOS for now
443+
run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} --features jit
456444

457445
lint:
458446
name: Lint Rust & Python code
@@ -514,7 +502,7 @@ jobs:
514502
runs-on: ubuntu-latest
515503
timeout-minutes: 30
516504
env:
517-
NIGHTLY_CHANNEL: nightly-2026-02-11 # https://github.com/rust-lang/miri/issues/4855
505+
NIGHTLY_CHANNEL: nightly
518506
steps:
519507
- uses: actions/checkout@v6.0.2
520508

.github/workflows/pr-auto-commit.yaml

Lines changed: 0 additions & 122 deletions
This file was deleted.

.github/workflows/pr-format.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Format Check
2+
3+
# This workflow triggers when a PR is opened/updated
4+
# Posts inline suggestion comments instead of auto-committing
5+
on:
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
branches:
9+
- main
10+
- release
11+
12+
concurrency:
13+
group: format-check-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
format_check:
18+
permissions:
19+
contents: read
20+
pull-requests: write
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 60
23+
steps:
24+
- name: Checkout PR branch
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Rust
28+
uses: dtolnay/rust-toolchain@stable
29+
with:
30+
components: rustfmt
31+
32+
- name: Run cargo fmt
33+
run: cargo fmt --all
34+
35+
- name: Install ruff
36+
uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
37+
with:
38+
version: "0.15.4"
39+
args: "--version"
40+
41+
- name: Run ruff format
42+
run: ruff format
43+
44+
- name: Run ruff check import sorting
45+
run: ruff check --select I --fix
46+
47+
- name: Run generate_opcode_metadata.py
48+
run: python scripts/generate_opcode_metadata.py
49+
50+
- name: Post formatting suggestions
51+
uses: reviewdog/action-suggester@v1
52+
with:
53+
tool_name: auto-format
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
level: warning
56+
filter_mode: diff_context

Cargo.lock

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

0 commit comments

Comments
 (0)