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

Qiskit / qiskit / 23308274945
87%

Build:
DEFAULT BRANCH: main
Ran 19 Mar 2026 06:22PM 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.254% (-0.001%) from 87.255%
23308274945

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%)

16 existing lines in 2 files now uncovered.

103522 of 118644 relevant lines covered (87.25%)

998594.84 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
4
92.29
0.0% crates/qasm2/src/lex.rs
12
96.21
-0.95% crates/qasm2/src/parse.rs
Jobs
ID Job ID Ran Files Coverage
1 23308274945.1 19 Mar 2026 06:22PM UTC 923
87.25
GitHub Action Run
Source Files on build 23308274945
  • Tree
  • List 923
  • Changed 5
  • Source Changed 2
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23308274945
  • 55f4eb1b on github
  • Prev Build on gh-readonly-queue/main/pr-14883-f0d87ec9d05633eae76f0d6845bae86635083b48 (#23306657596)
  • Next Build on main (#23310022357)
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