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

Qiskit / qiskit / 23307103168 / 1
87%
main: 88%

Build:
Build:
LAST BUILD BRANCH: gh-readonly-queue/main/pr-16081-b0459842b5b703f9e57df41f1ba409ff211fe2bb
DEFAULT BRANCH: main
Ran 19 Mar 2026 05:38PM UTC
Files 923
Run time 31s
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.1

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>

103545 of 118644 relevant lines covered (87.27%)

1000074.02 hits per line

Source Files on job 23307103168.1
  • Tree
  • List 923
  • Changed 6
  • Source Changed 2
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 23307103168
  • 55f4eb1b on github
  • Prev Job for on gh-readonly-queue/main/pr-15762-0551a40cb2df7bc91683e30b59e23e87ec7bf573 (#23306657596.1)
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