nustack

ext

Layer zero: the extension system, what a package plugs into a space with.

Module nuspace.ext.

Layer zero: the extension system, what a package plugs into a space with.

  • specs: Plane, what + creates, and Snippet, what / inserts. Plain data.
  • registry: Extension, a bundle of them, found through the nuspace.extensions entry point group, and the merged Registry a space opens with.

An extension imports from here, and nothing here imports the rest of nuspace.

Call

NameCallMeaning
discoverext.discover(group='nuspace.extensions')Every extension installed under group, in entry point order.
space_registryext.space_registry(planes=(), snippets=(), envs=None, extensions=None, discover=True)What a space registers: the loose arguments, then extensions, then installed ones.

discover

Every extension installed under group, in entry point order.

ext.discover(group='nuspace.extensions')

Path nuspace.ext.discover. Defined on nuspace.ext.registry, bound as a function. Builds list[Extension].

Each entry point loads to an Extension, or to a callable returning one. One that fails to load, or is neither, is skipped with a RegistryWarning.

Arguments

NameTypeDefaultMeaning
groupstr'nuspace.extensions'

Undocumented: example.

space_registry

What a space registers: the loose arguments, then extensions, then installed ones.

ext.space_registry(planes=(), snippets=(), envs=None, extensions=None, discover=True)

Path nuspace.ext.space_registry. Defined on nuspace.ext.registry, bound as a function. Builds Registry.

Arguments

NameTypeDefaultMeaning
planesSequence[Plane]()Planes passed directly, ahead of everything.
snippetsSequence[Snippet]()Snippets passed directly.
envsMapping[str, EnvFactory] | NoneNoneEnv factories passed directly.
extensionsSequence[Extension] | NoneNoneExplicit extensions, after the loose arguments.
discoverboolTrueAlso load the nuspace.extensions entry points.

Undocumented: example.

On this page