Repository navigation
v0.2.0
pkl 0.2.0 - a rewrite around a four-concept core
This is a breaking release. pkl now only does two things: it knows which plugin is executing, and it knows which resources each plugin owns. A registry is a lifetime: you call registry.release(plugin) whenever you decide that lifetime ends (disable, uninstall, anything else). Everything else is an extension that depends on the core, never the other way around.
Core
Plugin: an identity (same iffis). Derive, compose or wrap it to attach your own data.PluginTracker[P]: the currently executing plugin (per thread /asynciotask);bind(fn)runs a function as the plugin that was executing when it was bound.Resource: anything withrelease().ResourceRegistry[P]: plugin -> resources; thread-safe, releases newest first, keeps going after errors and raises anExceptionGroup.
Extensions (pkl.tracking, events, syscall, timing, files, modules)
Tracked/ResourceTracker/Callback: resources that register themselves under the plugin that created them.events:event_decorator(tracker)builds@event/@event(protected=False); events are invocable only by their owner by default; anyone can subscribe; subscriptions run as their subscriber.syscall,Timer,File/Directory/TempFile/TempDirectory,ModuleResource.- No global state: a process can run any number of independent hosts.
See the README and the documentation.
Breaking changes
- Python 3.11+ (was 3.9+).
- Removed, to be rebuilt as extensions or in your application: plugin metadata/manifests and
requireschecks, the enable/disable lifecycle and__enable__, child plugins, plugin-aware logging, lifecycle/resource hooks, the globalpkl.host,pkl.load_plugin,set_default_host, and thepkl.pluginsvirtual import. protectedon events now limits who may invoke (defaultTrue); subscribing is always open.
Also
- CI on Python 3.11-3.13 x Linux/Windows (
mypy --strict, 136 tests); publishing is gated on the same checks and on the tag matching the package version.