Skip to content

Commit 169afd7

Browse files
committed
no need to build cli for python tests
1 parent a40f3e4 commit 169afd7

File tree

3 files changed

+1
-42
lines changed

3 files changed

+1
-42
lines changed

.github/workflows/ci-py.yml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ on:
1313

1414
env:
1515
SCCACHE_GHA_ENABLED: "true"
16-
HUGR_BIN_DIR: ${{ github.workspace }}/target/debug
17-
HUGR_BIN: ${{ github.workspace }}/target/debug/hugr
1816
# Pinned version for the uv package manager
1917
UV_VERSION: "0.9.5"
2018
UV_FROZEN: 1
@@ -68,30 +66,8 @@ jobs:
6866
- name: Lint with ruff
6967
run: uv run ruff check
7068

71-
build_binary:
72-
needs: changes
73-
if: ${{ needs.changes.outputs.python == 'true' }}
74-
75-
name: Build HUGR binary
76-
runs-on: ubuntu-latest
77-
env:
78-
SCCACHE_GHA_ENABLED: "true"
79-
RUSTC_WRAPPER: "sccache"
80-
81-
steps:
82-
- uses: actions/checkout@v5
83-
- uses: mozilla-actions/[email protected]
84-
- name: Install stable toolchain
85-
uses: dtolnay/rust-toolchain@stable
86-
- name: Build HUGR binary
87-
run: cargo build -p hugr-cli
88-
- name: Upload the binary to the artifacts
89-
uses: actions/upload-artifact@v5
90-
with:
91-
name: hugr_binary
92-
path: target/debug/hugr
9369
test:
94-
needs: [changes, build_binary]
70+
needs: [changes]
9571
if: ${{ needs.changes.outputs.python == 'true' }}
9672
name: test python ${{ matrix.python-version.py }}
9773
runs-on: ubuntu-latest
@@ -110,12 +86,6 @@ jobs:
11086
version: ${{ env.UV_VERSION }}
11187
enable-cache: true
11288

113-
- name: Download the hugr binary
114-
uses: actions/download-artifact@v6
115-
with:
116-
name: hugr_binary
117-
path: ${{env.HUGR_BIN_DIR}}
118-
11989
- name: Setup dependencies
12090
run: uv sync --python ${{ matrix.python-version.py }}
12191

@@ -125,13 +95,11 @@ jobs:
12595
- name: Run tests
12696
if: github.event_name == 'merge_group' || !matrix.python-version.coverage
12797
run: |
128-
chmod +x $HUGR_BIN
12998
HUGR_RENDER_DOT=1 uv run pytest
13099
131100
- name: Run python tests with coverage instrumentation
132101
if: github.event_name != 'merge_group' && matrix.python-version.coverage
133102
run: |
134-
chmod +x $HUGR_BIN
135103
HUGR_RENDER_DOT=1 uv run pytest --cov=./ --cov-report=xml
136104
137105
- name: Upload python coverage to codecov.io

hugr-py/tests/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import os
4-
import pathlib
54
from dataclasses import dataclass
65
from enum import Enum
76
from typing import TYPE_CHECKING, TypeVar
@@ -147,13 +146,6 @@ def __call__(self, q: ComWire, fl_wire: ComWire) -> Command:
147146
Rz = RzDef()
148147

149148

150-
def _base_command() -> list[str]:
151-
workspace_dir = pathlib.Path(__file__).parent.parent.parent
152-
# use the HUGR_BIN environment variable if set, otherwise use the debug build
153-
bin_loc = os.environ.get("HUGR_BIN", str(workspace_dir / "target/debug/hugr"))
154-
return [bin_loc]
155-
156-
157149
def validate(
158150
h: Hugr | Package,
159151
*,

justfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ test-rust *TEST_ARGS: _check_nextest_installed
3232
# Run all python tests.
3333
test-python *TEST_ARGS:
3434
uv run maturin develop --uv
35-
cargo build -p hugr-cli
3635
HUGR_RENDER_DOT=1 uv run pytest {{TEST_ARGS}}
3736

3837
# Run all the benchmarks.

0 commit comments

Comments
 (0)