Skip to content

feat!: update dependencies (including PyO3) - #592

Merged
BatmanAoD merged 40 commits into
mainfrom
update-core-deps
Aug 20, 2026
Merged

feat!: update dependencies (including PyO3)#592
BatmanAoD merged 40 commits into
mainfrom
update-core-deps

Conversation

@BatmanAoD

@BatmanAoD BatmanAoD commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Note: updating PyO3 is a build-breaking change

Resolves #590

@windsurf-bot windsurf-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🤙

💡 To request another review, post a new comment with "/windsurf-review".

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-20 22:02 UTC

jselig-rigetti
jselig-rigetti previously approved these changes Jul 31, 2026
@BatmanAoD
BatmanAoD requested a review from erichulburd as a code owner August 11, 2026 21:15
@BatmanAoD
BatmanAoD force-pushed the update-core-deps branch 2 times, most recently from dfe5514 to a975de5 Compare August 12, 2026 03:16
BatmanAoD and others added 2 commits August 11, 2026 22:25
Two problems with the switch to uv, both of which only appear on a fresh checkout:

Scope VIRTUAL_ENV to the cargo-make tasks that need it, rather than setting it
globally. PyO3's build script reads VIRTUAL_ENV, so a global value pointed every
cargo build at a virtual environment that does not exist yet, breaking both the
pure-Rust `ci-flow` and `check-generated-python-files`:

    error: failed to run the Python interpreter at .../.venv/bin/python

Make libpython discoverable. `stub_gen` is a binary rather than an
`extension-module` cdylib, so it links against libpython and must find it at load
time. `ensure-venv` exports the interpreter's LIBDIR on LD_LIBRARY_PATH, but that
export does not survive from the `install-python-deps` task, as each cargo-make
task is its own process:

    stub_gen: error while loading shared libraries: libpython3.13.so.1.0

So `generate-stubs` sources `ensure-venv` directly, and CI publishes the same
environment job-wide — which is what `actions/setup-python` provided before it
was removed here as redundant.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The v1 action is a Node 20 action being force-run on Node 24, and intermittently
fails while downloading protoc:

    Error: self-signed certificate; if the root CA is installed locally, try
    running Node.js with --use-system-ca

v3 matches against protobuf's post-3.20 release names, so the pinned '3.20.1' no
longer resolves; 21.0 is its immediate successor and is what release-python.yml
already pins for its own v3 usage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BatmanAoD
BatmanAoD dismissed jselig-rigetti’s stale review August 12, 2026 04:37

significant changes, largely from LLM

@BatmanAoD BatmanAoD changed the title feat: update dependencies feat!: update dependencies (including PyO3) Aug 12, 2026
Comment thread .github/workflows/checks.yml Outdated
Comment thread .github/workflows/checks.yml Outdated
Comment thread .github/workflows/checks.yml Outdated
Comment thread .github/workflows/checks.yml
Comment thread .github/workflows/checks.yml Outdated
Comment thread crates/lib/Makefile.toml Outdated
Comment thread crates/lib/Makefile.toml Outdated
Comment thread crates/lib/Makefile.toml Outdated
Comment thread crates/lib/Makefile.toml Outdated
Comment thread scripts/ensure-venv Outdated
@BatmanAoD BatmanAoD mentioned this pull request Aug 12, 2026
BatmanAoD and others added 2 commits August 14, 2026 13:10
The `format` task previously targeted `python/qcs_sdk` — which is generated —
and `tests`, the Rust integration-test directory, so the actual Python sources
had never been formatted. This is the result of pointing it at them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BatmanAoD
BatmanAoD force-pushed the update-core-deps branch 2 times, most recently from f4e34c7 to 839f5a2 Compare August 14, 2026 19:23
Comment thread crates/lib/src/python/mod.rs
@BatmanAoD
BatmanAoD force-pushed the update-core-deps branch 2 times, most recently from 59cc76d to be2ebde Compare August 20, 2026 00:13

@asaites asaites left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with a couple non-blocking suggestions.

Comment thread crates/lib/Makefile.toml Outdated
Comment thread crates/lib/Makefile.toml Outdated
@BatmanAoD
BatmanAoD force-pushed the update-core-deps branch 2 times, most recently from ddab4ab to 7624158 Compare August 20, 2026 19:06
@BatmanAoD
BatmanAoD merged commit df923ca into main Aug 20, 2026
5 checks passed
@BatmanAoD
BatmanAoD deleted the update-core-deps branch August 20, 2026 21:58
BatmanAoD added a commit that referenced this pull request Aug 23, 2026
The merge of main kept this branch's side of two hunks that
"feat!: update dependencies (including PyO3) (#592)" had changed, breaking
two CI jobs:

  Run Python Checks failed at syphar/restore-virtualenv@v1 with "could not
  find requirement-files". #592 migrated to uv and removed that action in
  three places; the merge resurrected one, because this branch had added the
  adjacent "Install libquil" step. The same hunk also lost the sudo main uses
  for that step.

  publish-docs failed with stub_gen rejecting
  "Module 'qcs_sdk.qpu.experimental.random' ... is not under the PyO3 module
  path 'qcs_sdk._qcs_sdk'". This branch's rustfmt commit reformatted the
  pyclass attribute on PrngSeedValue, and the merge kept that version over
  main's fix, which moves it under _qcs_sdk and adds from_py_object.

Both files are now byte-identical to main, which is the check that they
carry no leftover divergence.
BatmanAoD added a commit that referenced this pull request Aug 26, 2026
The merge of main kept this branch's side of two hunks that
"feat!: update dependencies (including PyO3) (#592)" had changed, breaking
two CI jobs:

  Run Python Checks failed at syphar/restore-virtualenv@v1 with "could not
  find requirement-files". #592 migrated to uv and removed that action in
  three places; the merge resurrected one, because this branch had added the
  adjacent "Install libquil" step. The same hunk also lost the sudo main uses
  for that step.

  publish-docs failed with stub_gen rejecting
  "Module 'qcs_sdk.qpu.experimental.random' ... is not under the PyO3 module
  path 'qcs_sdk._qcs_sdk'". This branch's rustfmt commit reformatted the
  pyclass attribute on PrngSeedValue, and the merge kept that version over
  main's fix, which moves it under _qcs_sdk and adds from_py_object.

Both files are now byte-identical to main, which is the check that they
carry no leftover divergence.
BatmanAoD added a commit that referenced this pull request Aug 31, 2026
* style: apply rustfmt to random.rs

Formatting only, from running cargo fmt while working on the libquil build; no
behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* build: install the libquil prerelease that carries the sbcl-librarian runtime

libquil-sys 0.5 links against the sbcl-librarian runtime that libquil is built on, so it
needs a libquil that installs that runtime and its headers alongside libquil.h. Releases
up to and including 0.3.2 ship neither, and CI was installing 0.3.0 with the installer
from rigetti/libquil's default branch, which does not install the runtime either.

That build exists so far only as a prerelease from a fork, so pin both the version and
the repository it comes from, and take the installer from the tag being installed rather
than from a branch. TODO(github.com/rigetti/libquil#57) tracks removing the pin.

scripts/install-libquil now installs only the prerequisites -- libquil's own BLAS and
LAPACK, plus libclang for bindgen -- and hands off to libquil's installer instead of
duplicating what it does. It covers macOS via Homebrew as well as apt-based Linux, and
stops with an explanation elsewhere. The libffi.so.7 compat symlink is gone: the current
build does not link libffi at all, let alone that soname.

BLAS and LAPACK come from the -dev packages deliberately. magicl loads them at runtime
under their unversioned names, so Debian's libblas3, which provides only libblas.so.3,
is not enough.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test with libquil instead of qvm/quil-clients

* ci: release from the ref a prerelease is dispatched on

Cutting a prerelease from a branch tagged the wrong code. knope creates the GitHub
release against the default branch on the version this repository pins, so the version
bump landed on the branch while the tag landed on main, and the publish job -- which
checks out whatever that tag resolves to -- would then try to republish main's
already-released version.

Adopt what libquil-sys arrived at (545d05d):

- knope 0.23, which tags the ref being released;
- check out ${{ github.ref }} in prepare-release, so a dispatched release acts on the
  branch it was dispatched from;
- check out the release tag in release-library, so it publishes exactly what was tagged.

Verified against this branch with knope 0.23 locally: it now tags lib/v0.26.4-rc.0 at the
branch head rather than at main.

Add a changeset for the libquil-sys 0.5 dependency, which none of the branch's commit
types would have released on their own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: prepare new release(s) [skip ci]

* ci: build what was tagged when releasing the Python package

release-python.yml checks out without naming a ref, so every job builds the release
event's target commitish rather than the tagged commit. A release cut from a branch would
build main's code and publish it under the branch's version, the same way release-library
would have republished main's version before it was fixed.

Point all seven checkouts at the release tag, falling back to the dispatched ref for a
manual run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* build: install libquil from rigetti/libquil

The prerelease carrying the sbcl-librarian runtime is now published from rigetti/libquil
itself (v0.4.0-rc.0, built by its own CI), so the fork it was coming from is going away.
Drop LIBQUIL_RELEASE_REPO and fetch the installer straight from the tag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: drop two merge artifacts from the main merge

The merge of main kept this branch's side of two hunks that
"feat!: update dependencies (including PyO3) (#592)" had changed, breaking
two CI jobs:

  Run Python Checks failed at syphar/restore-virtualenv@v1 with "could not
  find requirement-files". #592 migrated to uv and removed that action in
  three places; the merge resurrected one, because this branch had added the
  adjacent "Install libquil" step. The same hunk also lost the sudo main uses
  for that step.

  publish-docs failed with stub_gen rejecting
  "Module 'qcs_sdk.qpu.experimental.random' ... is not under the PyO3 module
  path 'qcs_sdk._qcs_sdk'". This branch's rustfmt commit reformatted the
  pyclass attribute on PrngSeedValue, and the merge kept that version over
  main's fix, which moves it under _qcs_sdk and adds from_py_object.

Both files are now byte-identical to main, which is the check that they
carry no leftover divergence.

* update install-script path

* build: call libquil's installer directly, dropping the wrapper script

scripts/install-libquil installed libquil's prerequisites and then handed off to
libquil's own installer, because that installer could not install them itself. It
now can: --install-deps installs BLAS, LAPACK and libffi with apt or Homebrew,
checks that one of them is present, and reports what to install by hand
otherwise. The wrapper had become a reimplementation of what it wrapped.

libclang stays at the call sites: bindgen needs it to generate libquil-sys's
bindings, which makes it a consumer build dependency rather than a libquil
requirement. So do unzip and curl, which libquil's installer needs but cannot
bootstrap.

The version pin moves to a Dockerfile ARG and a workflow env, and the README now
shows the command rather than pointing at a script.

Also corrects the README's claim that omitting the version is fine: libquil's
latest release is 0.3.2, which ships neither the sbcl-librarian runtime nor its
headers, so the version has to be passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* build: pin libquil 0.4.0 now that it is released

Bumps LIBQUIL_VERSION from the 0.4.0-rc.1 prerelease to 0.4.0 in CI, the
devcontainer image and the README, and drops the README's warning about
omitting the version, which described the world before 0.4.0 existed.

The libquil-sys dependency stays at 0.5.0-rc.2: no stable 0.5.0 is published
yet, and it is the crate that has to pick up libquil 0.4.0 first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* pin to 0.4.1

* cleanup - delete unnecessary checkout defensiveness

* chore: prepare new release(s) [skip ci]

* chore: update lockfile

* chore: prepare new release(s) [skip ci]

* chore: remove prerelease from changelog

* chore: upgrade quil-rs and libquil-sys; removes paste from dependency tree

* chore: remove unused 'allow's from cargo-deny config

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should update rigetti-pyo3 and related dependencies

4 participants