Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into two-qubit-peephole-pa…
Browse files Browse the repository at this point in the history
…rallel-pass
  • Loading branch information
mtreinish committed Feb 19, 2025
2 parents aefdc90 + 55c7904 commit 746b953
Show file tree
Hide file tree
Showing 225 changed files with 6,507 additions and 17,633 deletions.
13 changes: 3 additions & 10 deletions .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,20 +96,13 @@ jobs:
sudo apt-get install -y graphviz
displayName: 'Install optional non-Python dependencies'
# Note that we explicitly use the virtual env with Qiskit installed to run the Rust
# tests since some of them still depend on Qiskit's Python API via PyO3.
- ${{ if eq(parameters.testRust, true) }}:
# We need to avoid linking our crates into full Python extension libraries during Rust-only
# testing because Rust/PyO3 can't handle finding a static CPython interpreter.
# Note that we use the virtual env with Qiskit installed to run the Rust
# tests since some of them still depend on Qiskit's Python API via PyO3.
- bash: |
source test-job/bin/activate
python tools/report_numpy_state.py
PYTHONUSERBASE="$VIRTUAL_ENV" cargo test --no-default-features
env:
# On Linux we link against `libpython` dynamically, but it isn't written into the rpath
# of the test executable (I'm not 100% sure why ---Jake). It's easiest just to forcibly
# include the correct place in the `dlopen` search path.
LD_LIBRARY_PATH: '$(usePython.pythonLocation)/lib:$LD_LIBRARY_PATH'
python tools/run_cargo_test.py
displayName: "Run Rust tests"
- bash: |
Expand Down
7 changes: 2 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@

# Qiskit folders (also their corresponding tests)
providers/ @Qiskit/terra-core @jyu00
quantum_info/ @Qiskit/terra-core
qpy/ @Qiskit/terra-core
pulse/ @Qiskit/terra-core @eggerdj @wshanks
synthesis/ @Qiskit/terra-core @alexanderivrii @ShellyGarion
scheduler/ @Qiskit/terra-core @eggerdj @wshanks
pulse/ @Qiskit/terra-core @eggerdj @wshanks @nkanazawa1989
scheduler/ @Qiskit/terra-core @eggerdj @wshanks @nkanazawa1989
visualization/ @Qiskit/terra-core @nonhermitian
primitives/ @Qiskit/terra-core @Qiskit/qiskit-primitives
# Override the release notes directories to have _no_ code owners, so any review
Expand Down
18 changes: 3 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,25 +619,13 @@ Then, run the following commands:

```bash
python setup.py build_rust --inplace
PYTHONUSERBASE="$VIRTUAL_ENV" cargo test --no-default-features
tools/run_cargo_test.py
```

> [!IMPORTANT]
> On Linux, you may need to first set your `LD_LIBRARY_PATH` env var to include the
> path to your Python installation's shared lib, e.g.:
> ```bash
> export LD_LIBRARY_PATH="$(python -c 'import sysconfig; print(sysconfig.get_config_var("LIBDIR"))'):$LD_LIBRARY_PATH"
> ```
The first command builds Qiskit in editable mode,
which ensures that Rust tests that interact with Qiskit's Python code actually
use the latest Python code from your working directory.
The second command actually invokes the tests via Cargo. The `PYTHONUSERBASE`
environment variable tells the embedded Python interpreter to look for packages
in your active virtual environment. The `--no-default-features`
flag is used to compile an isolated test runner without building a linked CPython
extension module (which would otherwise cause linker failures).
use the latest Python code from your working directory. The second command invokes
the tests via Cargo.

#### Calling Python from Rust tests
By default, our Cargo project configuration allows Rust tests to interact with the
Expand Down
Loading

0 comments on commit 746b953

Please sign in to comment.