Skip to content

Commit 672a95e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into bytecode-cleanup-oparg
2 parents 42da99f + 69601a1 commit 672a95e

File tree

26 files changed

+2858
-862
lines changed

26 files changed

+2858
-862
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,14 @@ env:
106106
test_weakref
107107
test_yield_from
108108
ENV_POLLUTING_TESTS_COMMON: >-
109-
test_threading
110109
ENV_POLLUTING_TESTS_LINUX: >-
111-
test.test_concurrent_futures.test_thread_pool
112110
test.test_multiprocessing_fork.test_processes
113111
test.test_multiprocessing_fork.test_threads
114112
test.test_multiprocessing_forkserver.test_processes
115113
test.test_multiprocessing_forkserver.test_threads
116114
test.test_multiprocessing_spawn.test_processes
117115
test.test_multiprocessing_spawn.test_threads
118116
ENV_POLLUTING_TESTS_MACOS: >-
119-
test.test_concurrent_futures.test_thread_pool
120117
test.test_multiprocessing_forkserver.test_processes
121118
test.test_multiprocessing_forkserver.test_threads
122119
test.test_multiprocessing_spawn.test_processes
@@ -297,21 +294,21 @@ jobs:
297294
env:
298295
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
299296
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
300-
timeout-minutes: 35
297+
timeout-minutes: 45
301298

302299
- if: runner.os == 'Linux'
303300
name: run cpython platform-dependent tests (Linux)
304301
env:
305302
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
306303
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
307-
timeout-minutes: 35
304+
timeout-minutes: 45
308305

309306
- if: runner.os == 'macOS'
310307
name: run cpython platform-dependent tests (MacOS)
311308
env:
312309
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
313310
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
314-
timeout-minutes: 35
311+
timeout-minutes: 45
315312

316313
- if: runner.os == 'Windows'
317314
name: run cpython platform-dependent tests (windows partial - fixme)
@@ -447,7 +444,7 @@ jobs:
447444
- name: Install ruff
448445
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
449446
with:
450-
version: "0.14.9"
447+
version: "0.14.11"
451448
args: "--version"
452449

453450
- run: ruff check --diff

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

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,77 @@ jobs:
3434
with:
3535
components: rustfmt
3636

37+
- name: Configure git
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
echo "" > /tmp/committed_commands.txt
42+
3743
- name: Run cargo fmt
3844
run: |
3945
echo "Running cargo fmt --all on PR #${{ github.event.pull_request.number }}"
4046
cargo fmt --all
47+
if [ -n "$(git status --porcelain)" ]; then
48+
git add -u
49+
git commit -m "Auto-format: cargo fmt --all"
50+
echo "- \`cargo fmt --all\`" >> /tmp/committed_commands.txt
51+
fi
4152
4253
- name: Install ruff
4354
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
4455
with:
45-
version: "0.14.9"
56+
version: "0.14.11"
4657
args: "--version"
4758

48-
- run: ruff format
49-
- run: ruff check --select I --fix
50-
- run: python scripts/generate_opcode_metadata.py
59+
- name: Run ruff format
60+
run: |
61+
ruff format
62+
if [ -n "$(git status --porcelain)" ]; then
63+
git add -u
64+
git commit -m "Auto-format: ruff format"
65+
echo "- \`ruff format\`" >> /tmp/committed_commands.txt
66+
fi
5167
52-
- name: Configure git
68+
- name: Run ruff check import sorting
5369
run: |
54-
git config user.name "github-actions[bot]"
55-
git config user.email "github-actions[bot]@users.noreply.github.com"
70+
ruff check --select I --fix
71+
if [ -n "$(git status --porcelain)" ]; then
72+
git add -u
73+
git commit -m "Auto-format: ruff check --select I --fix"
74+
echo "- \`ruff check --select I --fix\`" >> /tmp/committed_commands.txt
75+
fi
76+
77+
- name: Run generate_opcode_metadata.py
78+
run: |
79+
python scripts/generate_opcode_metadata.py
80+
if [ -n "$(git status --porcelain)" ]; then
81+
git add -u
82+
git commit -m "Auto-generate: generate_opcode_metadata.py"
83+
echo "- \`python scripts/generate_opcode_metadata.py\`" >> /tmp/committed_commands.txt
84+
fi
5685
5786
- name: Check for changes
5887
id: check-changes
5988
run: |
60-
if [ -n "$(git status --porcelain)" ]; then
89+
if [ "$(git rev-parse HEAD)" != "${{ github.event.pull_request.head.sha }}" ]; then
6190
echo "has_changes=true" >> $GITHUB_OUTPUT
6291
else
6392
echo "has_changes=false" >> $GITHUB_OUTPUT
6493
fi
6594
66-
- name: Commit and push formatting changes
95+
- name: Push formatting changes
6796
if: steps.check-changes.outputs.has_changes == 'true'
6897
run: |
69-
git add -u
70-
git commit -m "Auto-format: cargo fmt --all"
7198
git push origin HEAD:${{ github.event.pull_request.head.ref }}
7299
100+
- name: Read committed commands
101+
id: committed-commands
102+
if: steps.check-changes.outputs.has_changes == 'true'
103+
run: |
104+
echo "list<<EOF" >> $GITHUB_OUTPUT
105+
cat /tmp/committed_commands.txt >> $GITHUB_OUTPUT
106+
echo "EOF" >> $GITHUB_OUTPUT
107+
73108
- name: Comment on PR
74109
if: steps.check-changes.outputs.has_changes == 'true'
75110
uses: marocchino/sticky-pull-request-comment@v2
@@ -78,7 +113,8 @@ jobs:
78113
message: |
79114
**Code has been automatically formatted**
80115
81-
The code in this PR has been formatted using `cargo fmt --all`.
116+
The code in this PR has been formatted using:
117+
${{ steps.committed-commands.outputs.list }}
82118
Please pull the latest changes before pushing again:
83119
```bash
84120
git pull origin ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)