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

beartype / plum / 34147643730
99%

Build:
DEFAULT BRANCH: master
Ran 07 Sep 2026 05:27PM 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

07 Sep 2026 05:26PM UTC coverage: 99.335%. Remained the same
34147643730

push

github

web-flow
fix(mypyc): keep `Function` weak-referenceable on the compiled wheels (#319)

* fix(mypyc): keep `Function` weak-referenceable on the compiled wheels

Closes #317
Closes #318

Since 2.10.0 ships `mypyc`-compiled wheels with `_function.py` in the compile
set, `Function` is a native class. A native class has neither `__weakref__` nor
`__dict__`, and both absences are load-bearing for downstream code.

`jax.jit` registers the callable it wraps in a weakly-keyed cache, so every
`jax.jit(<dispatched function>)` now raises on first call:

    TypeError: cannot create weak reference to 'Function' object

That is issue #318. The missing instance dictionary is issue #317: the
`_DocDescriptor` attached to `Function` defines only `__get__`, so `f.__doc__ =
...` has nowhere to land and raises `AttributeError: ... is read-only`.

`__weakref__` cannot simply be declared. `mypyc` emits the member only when the
class already carries an instance dictionary, and on CPython 3.12+ the
managed-dict path drops it even then. Two nearby escape hatches do not work:
`@mypyc_attr(native_class=False)` on `Function` fails codegen outright with
`KeyError: 'object'` (and would forfeit the native-class win on the hottest
class in the library), and a `native_class=False` base declared in the *same*
compiled module still yields no `__weakref__` -- compiled and checked.

Inheriting from a base in a module that is *not* in the compile set does work:
`mypyc` then builds the class through CPython's normal type machinery, which
grants `__dict__` and `__weakref__`, and the class stays native. Hence `NativeBase`,
which lives in the interpreted `_mypyc` module beside the other `mypyc`
accommodations, and a comment on the `include` list so that module is not swept in
later.

* refactor(mypyc): retire the `native_class=False` invoke wrappers

`_InvokedMethod` and `_BoundInvokedMethod` opted out of native compilation for
exactly one reason, stated in `_InvokedMethod`'s own docstring: `functools.... (continued)

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

1045 of 1052 relevant lines covered (99.33%)

6.73 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-3.10 - 34147643730.1 07 Sep 2026 05:27PM UTC 16
98.85
GitHub Action Run
2 run-3.14-pre-beartype - 34147643730.2 07 Sep 2026 05:27PM UTC 16
99.28
GitHub Action Run
3 run-3.12 - 34147643730.3 07 Sep 2026 05:27PM UTC 16
98.94
GitHub Action Run
4 run-3.11 - 34147643730.4 07 Sep 2026 05:27PM UTC 16
98.94
GitHub Action Run
5 run-3.14 - 34147643730.5 07 Sep 2026 05:27PM UTC 16
99.28
GitHub Action Run
6 run-3.13 - 34147643730.6 07 Sep 2026 05:27PM UTC 16
98.94
GitHub Action Run
7 run-3.13-pre-beartype - 34147643730.7 07 Sep 2026 05:27PM UTC 16
98.94
GitHub Action Run
Source Files on build 34147643730
  • 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 #34147643730
  • c835c8cf on github
  • Prev Build on master (#34143372143)
  • Next Build on master (#34148156554)
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