• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 23307103168
87%
main: 87%

Build:
Build:
LAST BUILD BRANCH: standalone-synth-interfaces
DEFAULT BRANCH: main
Ran 19 Mar 2026 05:38PM UTC
Jobs 1
Files 923
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Mar 2026 05:07PM UTC coverage: 87.274% (+0.02%) from 87.255%
23307103168

push

github

web-flow
Add safe Python-extension module C API headers (#15762)

* Add safe Python-extension module C API headers

With the vtables now compiled into the `_accelerate` object and stored
in suitable `PyCapsule`s, the last step to exposing the complete ability
to compile Python extension modules is providing header-file support for
actually using the result.  This support is modelled on NumPy.

We generate alternate versions of the function declarations as part of
the `pyext` build script, which are loaded (instead of the standard
function prototypes) when the `QISKIT_PYTHON_EXTENSION` macro is set
prior to the inclusion of `qiskit.h`.  These declarations are all
pre-processor macros that resolve to compile-time constant offset
lookups into the vtables stored in the `PyCapsule`s, except we cache the
internal pointer of each `PyCapsule` into a compilation-unit-local
`static`.  If we didn't have this cache, _all_ function calls would have
Python-API overhead and require an attached Python thread state (holding
the GIL).

The cache population is done by a new header-only function `qk_import`
defined in (the non-stub version of) `funcs_py.h`, which then must be
called _before_ any C API function.  This will almost invariably be done
inside the `PyInit_*` module-initialisation function of the extension.

The cache mechanism introduced in this commit is local to a single
translation unit.  It is possible to extend this to allow sharing it
between different translation units, but since this necessarily requires
exposing a non-`static` symbol out of a library, we will have to take
care to do it with a mechanism that allows the user to override the
names used.

* Remove `dbg!` call from build script

* Remove unneeded `pyo3-build-config` dependence

* Fix typos

Co-authored-by: Max Rossmannek <21973473+mrossinek@users.noreply.github.com>
Co-authored-by: Jake Lishman <jake@binhbar.com>

---------

Co-authored-by: Max Rossmannek <21973473+mrossinek@users.noreply.github.com>

91 of 94 new or added lines in 2 files covered. (96.81%)

14 existing lines in 3 files now uncovered.

103545 of 118644 relevant lines covered (87.27%)

1000074.02 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
97.22
-2.78% crates/pyext/build.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
86.99
0.0% crates/circuit/src/parameter/parameter_expression.rs
6
97.63
0.47% crates/qasm2/src/parse.rs
7
91.52
-0.77% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 23307103168.1 19 Mar 2026 05:38PM UTC 923
87.27
GitHub Action Run
Source Files on build 23307103168
  • Tree
  • List 923
  • Changed 6
  • Source Changed 2
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23307103168
  • 55f4eb1b on github
  • Prev Build on gh-readonly-queue/main/pr-14883-f0d87ec9d05633eae76f0d6845bae86635083b48 (#23306657596)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc