X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-2025]
os:
- macos-latest
- ubuntu-latest
- windows-2025
fail-fast: false
steps:
- uses: actions/checkout@v6.0.2
Expand All @@ -302,18 +305,14 @@ jobs:
- uses: actions/setup-python@v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up the Mac environment
run: brew install autoconf automake libtool openssl@3
if: runner.os == 'macOS'

- name: build rustpython
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }}
if: runner.os == 'macOS'
- name: build rustpython
run: cargo build --release --verbose --features=threading ${{ env.CARGO_ARGS }},jit
if: runner.os != 'macOS'
- uses: actions/setup-python@v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
run: cargo build --release --verbose --features=threading,jit ${{ env.CARGO_ARGS }}

- name: run snippets
run: python -m pip install -r requirements.txt && pytest -v
working-directory: ./extra_tests
Expand Down Expand Up @@ -445,14 +444,10 @@ jobs:
run: |
target/release/rustpython -m venv testvenv
testvenv/bin/rustpython -m pip install wheel
- if: runner.os != 'macOS'
name: Check whats_left is not broken
shell: bash
run: python -I scripts/whats_left.py --no-default-features --features "$(sed -e 's/--[^ ]*//g' <<< "${{ env.CARGO_ARGS }}" | tr -d '[:space:]'),threading,jit"
- if: runner.os == 'macOS' # TODO fix jit on macOS
name: Check whats_left is not broken (macOS)

- name: Check whats_left is not broken
shell: bash
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
run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} --features jit

lint:
name: Lint Rust & Python code
Expand Down
14 changes: 9 additions & 5 deletions scripts/whats_left.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def parse_args():
)
parser.add_argument(
"--features",
action="store",
help="which features to enable when building RustPython (default: ssl)",
default="ssl",
action="append",
help="which features to enable when building RustPython (default: [])",
default=[],
)

args = parser.parse_args()
Expand Down Expand Up @@ -449,16 +449,20 @@ def remove_one_indent(s):
cargo_build_command = ["cargo", "build", "--release"]
if args.no_default_features:
cargo_build_command.append("--no-default-features")

joined_features = ",".join(args.features)
if args.features:
cargo_build_command.extend(["--features", args.features])
cargo_build_command.extend(["--features", joined_features])

subprocess.run(cargo_build_command, check=True)

cargo_run_command = ["cargo", "run", "--release"]
if args.no_default_features:
cargo_run_command.append("--no-default-features")

if args.features:
cargo_run_command.extend(["--features", args.features])
cargo_run_command.extend(["--features", joined_features])

cargo_run_command.extend(["-q", "--", GENERATED_FILE])

result = subprocess.run(
Expand Down
Loading
X Tutup