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

beartype / plum / 30304175023
99%

Build:
DEFAULT BRANCH: master
Ran 27 Jul 2026 08:49PM UTC
Jobs 7
Files 16
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

27 Jul 2026 08:48PM UTC coverage: 99.494% (+0.004%) from 99.49%
30304175023

push

github

web-flow
build(mypyc): compile `_type` via a guarded `mypyc_attr` shim (#287)

* build(mypyc): compile `_signature` for faster parametric dispatch

Adds `src/plum/_signature.py` to the `mypyc` compilation allowlist. This
compiles the `Signature` type and its comparison machinery to native code,
giving a ~18% speedup on parametric dispatch (`tests/benchmark.py`: 3.82 ->
3.12 us median) with no change to the simple-call paths, which live in the
still-interpreted `_function`.

Compiling `_signature` makes `Signature` a native extension type. As a result
the already-compiled `_dispatcher.multi` now type-checks its
`Signature | tuple[...]` vararg at the C boundary, so a bad argument (e.g.
`dispatch.multi(1)`) raises `TypeError` instead of reaching the method body.
To keep behaviour identical across the pure-Python and compiled builds, the
method's own validation now raises `TypeError` (was `ValueError`) for a
non-tuple/non-Signature argument, and its test is updated to match. The
informative `Signature | tuple[...]` annotation is kept.

* build(mypyc): compile `_type` via a guarded `mypyc_attr` shim

Adds `src/plum/_type.py` to the `mypyc` compilation allowlist. Its three
`type`-subclassing classes (`ResolvableType`, `PromisedType`, `ModuleType`)
cannot be native extension classes, so each is marked
`@mypyc_attr(native_class=False)`.

`mypyc_attr` lives in `mypy_extensions`, which is present when building the
compiled wheel but is not a runtime dependency. It is therefore imported once,
behind a `try/except`, from a new single-purpose `plum._mypyc` module that
falls back to a no-op decorator in a pure-Python install. `mypyc` still
recognises the decorator through this shared re-export, so classes across the
package can opt out of native compilation from one place.

`PromisedType.__new__` used `super().__new__(...)`, which `mypyc` cannot
generate for a non-extension class (`object.__new__()` unsupported). It now
calls `ResolvableType.__new__(...)` explicitly, matchi... (continued)

9 of 9 new or added lines in 2 files covered. (100.0%)

984 of 989 relevant lines covered (99.49%)

6.75 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.13 - 30304175023.1 27 Jul 2026 08:49PM UTC 16
99.08
GitHub Action Run
2 run-3.12 - 30304175023.2 27 Jul 2026 08:49PM UTC 16
99.08
GitHub Action Run
3 run-3.14 - 30304175023.3 27 Jul 2026 08:49PM UTC 16
99.46
GitHub Action Run
4 run-3.11 - 30304175023.4 27 Jul 2026 08:49PM UTC 16
99.08
GitHub Action Run
5 run-3.10 - 30304175023.5 27 Jul 2026 08:49PM UTC 16
99.08
GitHub Action Run
6 run-3.13-pre-beartype - 30304175023.6 27 Jul 2026 08:49PM UTC 16
99.08
GitHub Action Run
7 run-3.14-pre-beartype - 30304175023.7 27 Jul 2026 08:49PM UTC 16
99.46
GitHub Action Run
Source Files on build 30304175023
  • Tree
  • List 16
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30304175023
  • 6840ebbd on github
  • Prev Build on master (#30299177442)
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