Skip to content

Commit ffc0d8a

Browse files
morealclaudeyouknowonefanninpm
authored andcommitted
Fix some parts of cron-ci workflow (RustPython#6724)
* Use shared PYTHON_VERSION in cron-ci benchmark job * Correct extra-tests/jsontests.py script When the `extra_tests/jsontests.py` script was added, it was presumably during the time when Python versions 3.5 to 3.8 were in use. At that time, `test.libregrtest.runtest` was a valid path, but from CPython version 3.11 onwards, the path changed to `test.libregrtest.findtests`. * Use ssl-rustls feature instead of ssl in cron-ci workflow Replace the ssl feature with ssl-rustls in both the CARGO_ARGS environment variable and the cargo-llvm-cov test command to fix the cron-ci workflow. Since 1a783fc, it is disallowed to use ssl manually. * Replace inspect.getargspec with inspect.getfullargspec in custom_text_test_runner inspect.getargspec() was removed in Python 3.11, causing jsontests.py to fail with "TypeError: 'NoneType' object is not iterable" when running on RustPython (which targets Python 3.13). The get_function_args() function was silently catching the AttributeError and returning None, which then caused the error in store_class_fields() when trying to iterate over None. > https://docs.python.org/3/whatsnew/3.11.html > The getargspec() function, deprecated since Python 3.0; use > inspect.signature() or inspect.getfullargspec() instead. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Exclude rustpython-venvlauncher in cron-ci workflow Since rustpython-venvlauncher is Windows-only, it disables the project in the cron-ci workflow. * Apply suggestion from @fanninpm Co-authored-by: fanninpm <luxverdans@sbcglobal.net> * Trigger cron-ci workflow in pull_request --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com> Co-authored-by: fanninpm <luxverdans@sbcglobal.net>
1 parent a46b1b1 commit ffc0d8a

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/cron-ci.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ on:
55
push:
66
paths:
77
- .github/workflows/cron-ci.yaml
8+
pull_request:
9+
paths:
10+
- .github/workflows/cron-ci.yaml
811

912
name: Periodic checks/tasks
1013

1114
env:
12-
CARGO_ARGS: --no-default-features --features stdlib,importlib,encodings,ssl,jit
15+
CARGO_ARGS: --no-default-features --features stdlib,importlib,encodings,ssl-rustls,jit
1316
PYTHON_VERSION: "3.13.1"
1417

1518
jobs:
@@ -29,7 +32,7 @@ jobs:
2932
python-version: ${{ env.PYTHON_VERSION }}
3033
- run: sudo apt-get update && sudo apt-get -y install lcov
3134
- name: Run cargo-llvm-cov with Rust tests.
32-
run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --verbose --no-default-features --features stdlib,importlib,encodings,ssl,jit
35+
run: cargo llvm-cov --no-report --workspace --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher --verbose --no-default-features --features stdlib,importlib,encodings,ssl-rustls,jit
3336
- name: Run cargo-llvm-cov with Python snippets.
3437
run: python scripts/cargo-llvm-cov.py
3538
continue-on-error: true
@@ -39,6 +42,7 @@ jobs:
3942
- name: Prepare code coverage data
4043
run: cargo llvm-cov report --lcov --output-path='codecov.lcov'
4144
- name: Upload to Codecov
45+
if: ${{ github.event_name != 'pull_request' }}
4246
uses: codecov/codecov-action@v5
4347
with:
4448
file: ./codecov.lcov
@@ -58,6 +62,7 @@ jobs:
5862
env:
5963
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
6064
- name: upload tests data to the website
65+
if: ${{ github.event_name != 'pull_request' }}
6166
env:
6267
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
6368
GITHUB_ACTOR: ${{ github.actor }}
@@ -94,6 +99,7 @@ jobs:
9499
env:
95100
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
96101
- name: Upload data to the website
102+
if: ${{ github.event_name != 'pull_request' }}
97103
env:
98104
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
99105
GITHUB_ACTOR: ${{ github.actor }}
@@ -141,7 +147,7 @@ jobs:
141147
- uses: dtolnay/rust-toolchain@stable
142148
- uses: actions/setup-python@v6.1.0
143149
with:
144-
python-version: 3.9
150+
python-version: ${{ env.PYTHON_VERSION }}
145151
- run: cargo install cargo-criterion
146152
- name: build benchmarks
147153
run: cargo build --release --benches
@@ -162,6 +168,7 @@ jobs:
162168
mv reports/* .
163169
rmdir reports
164170
- name: upload benchmark data to the website
171+
if: ${{ github.event_name != 'pull_request' }}
165172
env:
166173
SSHKEY: ${{ secrets.ACTIONS_TESTS_DATA_DEPLOY_KEY }}
167174
run: |

extra_tests/custom_text_test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __call__(self, data_list, totals=None):
112112

113113
def get_function_args(func_ref):
114114
try:
115-
return [p for p in inspect.getargspec(func_ref).args if p != "self"]
115+
return [p for p in inspect.getfullargspec(func_ref).args if p != "self"]
116116
except:
117117
return None
118118

extra_tests/jsontests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33

44
from custom_text_test_runner import CustomTextTestRunner as Runner
5-
from test.libregrtest.runtest import findtests
5+
from test.libregrtest.findtests import findtests
66

77
testnames = findtests()
88
# idk why this fixes the hanging, if it does

0 commit comments

Comments
 (0)