diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a58490666c7..c476a07fbff 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 @@ -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 @@ -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 diff --git a/scripts/whats_left.py b/scripts/whats_left.py index 00db9a0ac5c..9a4d57df6ae 100755 --- a/scripts/whats_left.py +++ b/scripts/whats_left.py @@ -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() @@ -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(