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

scikit-hep / pyhepmc / 43248118698
97%

Build:
DEFAULT BRANCH: main
Ran 12 Nov 2026 03:30PM UTC
Jobs 1
Files 10
Run time 1min
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

12 Nov 2026 03:28PM UTC coverage: 96.838%. Remained the same
43248118698

push

github

web-flow
Support free-threaded Python and avoid non-limited-API calls (#129)

Addresses the remaining points of #126 by @henryiii. **Stacked on #128**
(based on `feat/scikit-build-core`; it needs pybind11 3 from PyPI). Will
retarget to `main` once #128 is merged.

### Changes
- **Free-threading:** `PYBIND11_MODULE(_core, m,
py::mod_gil_not_used())`. The bindings never release the GIL and keep no
mutable globals of their own. HepMC3's only global state is the `Setup`
print/debug flags. Using *separate* objects from different threads is
therefore safe. As with other free-threaded extensions, an object
*shared* between threads (e.g. one reader or one `GenEvent`) has to be
synchronized by the caller.
- **Wheels/CI:** cibuildwheel no longer skips `cp3*t`, so free-threaded
wheels are built and tested. `test.yml` gains an `ubuntu-latest` /
`3.14t` job.
- **Limited API (#126):** `PyByteArray_AS_STRING` →
`PyByteArray_AsString`. The writer no longer shrinks the bytearray with
`Py_SET_SIZE`; it passes a zero-copy `memoryview` of the filled part of
the buffer to `write()`. This also removes writes past the bytearray's
nominal size after shrinking. This PR does **not** build abi3 wheels;
that can follow once pybind11's limited-API support settles.
- **Test:** `tests/test_threads.py` runs 8 threads that each write and
read back their own file in the hepmc3/hepmc2/hepevt formats.

- **Fix for the bundled HepMC3 (found by the new test on musllinux):**
`ReaderAscii`, `ReaderAsciiHepMC2` and `ReaderHEPEVT` put a 256 KiB
`std::array<char, 262144>` line buffer on the stack. That overflows
musl's 128 KiB default thread stack, so reading in any non-main thread
segfaults on Alpine, with or without the GIL; this also affects `main`.
Upstream HepMC3 `master` has the same code. `CMakeLists.txt` now
compiles patched copies of these three files from the build tree with a
`std::vector<char>` buffer. Configuration fails if the replaced text is
no longer found after a submodule update, so ... (continued)

490 of 506 relevant lines covered (96.84%)

0.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 43248118698.1 12 Nov 2026 03:30PM UTC 10
96.84
GitHub Action Run
Source Files on build 43248118698
  • Tree
  • List 10
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 405e49ea on github
  • Prev Build on main (#42605641369)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc