| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a7217a0 commit d7e41eb
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -125,14 +125,34 @@ jobs: | |||
| 125 | 125 | - name: Install macOS dependencies | |
| 126 | 126 | uses: ./.github/actions/install-macos-deps | |
| 127 | 127 | ||
| 128 | + - name: Build rust tests | ||
| 129 | + run: cargo test --no-run --locked --workspace --exclude rustpython-capi ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }} | ||
| 130 | + env: | ||
| 131 | + INSTA_WORKSPACE_ROOT: ${{ github.workspace }} | ||
| 132 | + | ||
| 128 | 133 | - name: run rust tests | |
| 129 | - run: cargo test --locked --workspace --exclude rustpython-capi ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }} | ||
| 134 | + run: cargo test --locked --workspace --exclude rustpython-capi ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }} --lib --bins --tests | ||
| 135 | + env: | ||
| 136 | + INSTA_WORKSPACE_ROOT: ${{ github.workspace }} | ||
| 137 | + | ||
| 138 | + - name: Run rust doctests | ||
| 139 | + run: cargo test --doc --locked --workspace --exclude rustpython-capi ${{ env.WORKSPACE_EXCLUDES }} --features threading ${{ env.CARGO_ARGS }} | ||
| 130 | 140 | env: | |
| 131 | 141 | INSTA_WORKSPACE_ROOT: ${{ github.workspace }} | |
| 132 | 142 | ||
| 143 | + - name: Build c-api tests | ||
| 144 | + working-directory: crates/capi | ||
| 145 | + run: cargo test --no-run --locked | ||
| 146 | + if: runner.os != 'Windows' # Requires pyo3 0.29+ on Windows | ||
| 147 | + | ||
| 133 | 148 | - name: run c-api tests | |
| 134 | 149 | working-directory: crates/capi | |
| 135 | - run: cargo test --locked | ||
| 150 | + run: cargo test --locked --lib --bins --tests | ||
| 151 | + if: runner.os != 'Windows' # Requires pyo3 0.29+ on Windows | ||
| 152 | + | ||
| 153 | + - name: Run c-api doctests | ||
| 154 | + working-directory: crates/capi | ||
| 155 | + run: cargo test --doc --locked | ||
| 136 | 156 | if: runner.os != 'Windows' # Requires pyo3 0.29+ on Windows | |
| 137 | 157 | ||
| 138 | 158 | - name: check compilation without host_env (sandbox mode) | |
@@ -164,14 +184,24 @@ jobs: | |||
| 164 | 184 | # run: cargo build --features tkinter | |
| 165 | 185 | # if: runner.os == 'Linux' | |
| 166 | 186 | ||
| 167 | - - name: Test example projects | ||
| 187 | + - name: Build example projects | ||
| 188 | + run: | | ||
| 189 | + cargo build --manifest-path example_projects/barebone/Cargo.toml | ||
| 190 | + cargo build --manifest-path example_projects/frozen_stdlib/Cargo.toml | ||
| 191 | + if: runner.os == 'Linux' | ||
| 192 | + | ||
| 193 | + - name: Run example projects | ||
| 168 | 194 | run: | | |
| 169 | - cargo run --manifest-path example_projects/barebone/Cargo.toml | ||
| 170 | - cargo run --manifest-path example_projects/frozen_stdlib/Cargo.toml | ||
| 195 | + example_projects/barebone/target/debug/example-barebone | ||
| 196 | + example_projects/frozen_stdlib/target/debug/example_frozen_stdlib | ||
| 197 | + if: runner.os == 'Linux' | ||
| 198 | + | ||
| 199 | + - name: Build rustpython for update_lib tests | ||
| 200 | + run: cargo build --locked | ||
| 171 | 201 | if: runner.os == 'Linux' | |
| 172 | 202 | ||
| 173 | 203 | - name: run update_lib tests | |
| 174 | - run: cargo run --locked -- -m unittest discover -s scripts/update_lib/tests -v | ||
| 204 | + run: target/debug/rustpython -m unittest discover -s scripts/update_lib/tests -v | ||
| 175 | 205 | env: | |
| 176 | 206 | PYTHONPATH: scripts | |
| 177 | 207 | if: runner.os == 'Linux' | |
@@ -487,7 +517,7 @@ jobs: | |||
| 487 | 517 | ||
| 488 | 518 | - name: Check whats_left is not broken | |
| 489 | 519 | shell: bash | |
| 490 | - run: python -I scripts/whats_left.py ${{ env.CARGO_ARGS }} --features jit | ||
| 520 | + run: python -I scripts/whats_left.py --rustpython target/release/rustpython | ||
| 491 | 521 | ||
| 492 | 522 | clippy: | |
| 493 | 523 | # Named after the matrix entry rather than left to be named for it: a | |
@@ -681,6 +711,11 @@ jobs: | |||
| 681 | 711 | restore-keys: | | |
| 682 | 712 | ${{ runner.os }}- | |
| 683 | 713 | ||
| 714 | + - name: Build tests under miri | ||
| 715 | + run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test --no-run --locked -p rustpython-vm -- miri_test | ||
| 716 | + env: | ||
| 717 | + MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-permissive-provenance" | ||
| 718 | + | ||
| 684 | 719 | - name: Run tests under miri | |
| 685 | 720 | run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test --locked -p rustpython-vm -- miri_test | |
| 686 | 721 | env: | |
@@ -769,15 +804,20 @@ jobs: | |||
| 769 | 804 | with: | |
| 770 | 805 | wabt-version: "1.0.36" | |
| 771 | 806 | ||
| 772 | - - name: check wasm32-unknown without js | ||
| 807 | + - name: Build wasm32-unknown without js | ||
| 808 | + working-directory: example_projects/wasm32_without_js/rustpython-without-js | ||
| 809 | + run: cargo build | ||
| 810 | + | ||
| 811 | + - name: Build wasm-runtime | ||
| 812 | + run: cargo build --release --manifest-path example_projects/wasm32_without_js/wasm-runtime/Cargo.toml | ||
| 813 | + | ||
| 814 | + - name: Check wasm32-unknown without js | ||
| 815 | + working-directory: example_projects/wasm32_without_js | ||
| 773 | 816 | run: | | |
| 774 | - cd example_projects/wasm32_without_js/rustpython-without-js | ||
| 775 | - cargo build | ||
| 776 | - cd .. | ||
| 777 | 817 | if wasm-objdump -xj Import rustpython-without-js/target/wasm32-unknown-unknown/debug/rustpython_without_js.wasm; then | |
| 778 | 818 | echo "ERROR: wasm32-unknown module expects imports from the host environment" >&2 | |
| 779 | 819 | fi | |
| 780 | - cargo run --release --manifest-path wasm-runtime/Cargo.toml rustpython-without-js/target/wasm32-unknown-unknown/debug/rustpython_without_js.wasm | ||
| 820 | + wasm-runtime/target/release/wasm-runtime rustpython-without-js/target/wasm32-unknown-unknown/debug/rustpython_without_js.wasm | ||
| 781 | 821 | ||
| 782 | 822 | - name: build notebook demo | |
| 783 | 823 | if: github.ref == 'refs/heads/release' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,4 +52,4 @@ def benchamark_collection(loops, cycles, links): | |||
| 52 | 52 | ||
| 53 | 53 | assert collected is None or collected >= cycles * (links + 1) | |
| 54 | 54 | ||
| 55 | - benchamark_collection(1, CYCLES, LINKS) | ||
| 55 | + benchamark_collection(10, CYCLES, LINKS) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,10 @@ def parse_args(): | |||
| 71 | 71 | help="which features to enable when building RustPython (default: [])", | |
| 72 | 72 | default=[], | |
| 73 | 73 | ) | |
| 74 | + parser.add_argument( | ||
| 75 | + "--rustpython", | ||
| 76 | + help="use this RustPython executable instead of building one with cargo", | ||
| 77 | + ) | ||
| 74 | 78 | ||
| 75 | 79 | args = parser.parse_args() | |
| 76 | 80 | return args | |
@@ -446,27 +450,40 @@ def remove_one_indent(s): | |||
| 446 | 450 | f.write(output + "\n") | |
| 447 | 451 | ||
| 448 | 452 | ||
| 449 | - cargo_build_command = ["cargo", "build", "--release"] | ||
| 450 | - if args.no_default_features: | ||
| 451 | - cargo_build_command.append("--no-default-features") | ||
| 453 | + def resolve_rustpython(path): | ||
| 454 | + if os.path.isfile(path): | ||
| 455 | + return path | ||
| 456 | + if os.name == "nt" and not path.lower().endswith(".exe"): | ||
| 457 | + exe = path + ".exe" | ||
| 458 | + if os.path.isfile(exe): | ||
| 459 | + return exe | ||
| 460 | + sys.exit(f"RustPython executable not found: {path}") | ||
| 461 | + | ||
| 462 | + | ||
| 463 | + if args.rustpython: | ||
| 464 | + rustpython_run_command = [resolve_rustpython(args.rustpython), GENERATED_FILE] | ||
| 465 | + else: | ||
| 466 | + cargo_build_command = ["cargo", "build", "--release"] | ||
| 467 | + if args.no_default_features: | ||
| 468 | + cargo_build_command.append("--no-default-features") | ||
| 452 | 469 | ||
| 453 | - joined_features = ",".join(args.features) | ||
| 454 | - if args.features: | ||
| 455 | - cargo_build_command.extend(["--features", joined_features]) | ||
| 470 | + joined_features = ",".join(args.features) | ||
| 471 | + if args.features: | ||
| 472 | + cargo_build_command.extend(["--features", joined_features]) | ||
| 456 | 473 | ||
| 457 | - subprocess.run(cargo_build_command, check=True) | ||
| 474 | + subprocess.run(cargo_build_command, check=True) | ||
| 458 | 475 | ||
| 459 | - cargo_run_command = ["cargo", "run", "--release"] | ||
| 460 | - if args.no_default_features: | ||
| 461 | - cargo_run_command.append("--no-default-features") | ||
| 476 | + rustpython_run_command = ["cargo", "run", "--release"] | ||
| 477 | + if args.no_default_features: | ||
| 478 | + rustpython_run_command.append("--no-default-features") | ||
| 462 | 479 | ||
| 463 | - if args.features: | ||
| 464 | - cargo_run_command.extend(["--features", joined_features]) | ||
| 480 | + if args.features: | ||
| 481 | + rustpython_run_command.extend(["--features", joined_features]) | ||
| 465 | 482 | ||
| 466 | - cargo_run_command.extend(["-q", "--", GENERATED_FILE]) | ||
| 483 | + rustpython_run_command.extend(["-q", "--", GENERATED_FILE]) | ||
| 467 | 484 | ||
| 468 | 485 | result = subprocess.run( | |
| 469 | - cargo_run_command, | ||
| 486 | + rustpython_run_command, | ||
| 470 | 487 | env={**os.environ.copy(), "RUSTPYTHONPATH": "Lib"}, | |
| 471 | 488 | text=True, | |
| 472 | 489 | capture_output=True, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments