Skip to content

fix(py): Type stubs for calibration types reflect breaking changes in 0.13.0 #1569

fix(py): Type stubs for calibration types reflect breaking changes in 0.13.0

fix(py): Type stubs for calibration types reflect breaking changes in 0.13.0 #1569

Workflow file for this run

# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md
on:
push:
branches: [main]
pull_request:
name: MSRV
jobs:
check:
name: Check
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
check-py:
name: Check quil-py
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
path: quil-rs
- uses: actions/checkout@v4
with:
repository: "rigetti/pyquil"
path: pyquil
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- uses: syphar/restore-virtualenv@v1
- name: Run quil-py tests, lints, and formatting checks.
run: |
cargo make --cwd quil-rs/quil-py
- name: Check changes against pyQuil
id: check_pyquil
continue-on-error: true
run: |
set -o pipefail
rm -f warnings.log # Clear previous warnings log if exists
pip uninstall -y -r <(pip freeze) || true
pip install "./pyquil[latex]" maturin mypy ruff pytest
maturin develop -m quil-rs/quil-py/Cargo.toml
mypy_output=$(mypy pyquil/pyquil 2>&1) || echo "### mypy found issues ###\n$mypy_output" >> warnings.log
ruff_output=$(ruff check pyquil/pyquil 2>&1) || echo "### ruff found issues ###\n$ruff_output" >> warnings.log
pytest_output=$(pytest pyquil/test/unit -x 2>&1) || echo "### Some pyQuil tests have failed ###\n$pytest_output" >> warnings.log
- name: Summarize warnings from pyQuil checks
if: always()
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const warningsFilePath = 'warnings.log';
if (fs.existsSync(warningsFilePath)) {
const warnings = fs.readFileSync(warningsFilePath, 'utf8').trim();
if (warnings.length > 0) {
const prNumber = context.issue.number;
github.rest.issues.createComment({
...context.repo,
issue_number: prNumber,
body: `⚠️ **Warnings Detected** from pyQuil checks on Python ${process.env.PYTHON_VERSION}:\n\n\`\`\`\n${warnings}\n\`\`\`\n**Note**: These warnings don't block the PR but need review for potential issues.`
});
}
}
fmt:
name: Rustfmt
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Install rustfmt
run: rustup component add rustfmt
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Install clippy
run: rustup component add clippy
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
deny:
name: Deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: EmbarkStudios/cargo-deny-action@v1