httk.core.plugins

Re-export the httk plugin APIs.

Submodules

Attributes

Classes

InstalledPlugin

Describe one installed plugin and its installer metadata.

PluginManifest

Describe a validated plugin manifest.

PluginProgram

Describe one declared plugin program.

Functions

build_plugin(name)

Build and publish the declared programs of an installed plugin.

install_plugin(source, *[, force])

Install one plugin from an existing local directory.

uninstall_plugin(name)

Remove an installed plugin and its still-owned shims.

installed_plugins()

Read all valid installed plugins.

plugin_program(name, program)

Return the absolute path of an installed plugin program.

plugin_root(name)

Return the root of an installed plugin.

plugins_home()

Return the installed plugin directory.

shims_home()

Return the plugin shim directory.

parse_plugin_manifest(directory)

Parse and validate one plugin manifest.

Package Contents

httk.core.plugins.build_plugin(name)[source]

Build and publish the declared programs of an installed plugin.

httk.core.plugins.install_plugin(source, *, force=False)[source]

Install one plugin from an existing local directory.

source_sha256 is pre-build provenance: build output and the build log may change the installed tree after this digest is recorded.

Parameters:
  • source (str | pathlib.Path) – Supply the local plugin directory.

  • force (bool) – Replace an installed plugin with the same name.

Returns:

The installed plugin.

Raises:

ValueError – If the source or plugin is invalid or cannot be built.

Return type:

httk.core.plugins.installed.InstalledPlugin

httk.core.plugins.uninstall_plugin(name)[source]

Remove an installed plugin and its still-owned shims.

httk.core.plugins.PLUGIN_MANIFEST = 'httk_plugin.toml'[source]
httk.core.plugins.PLUGIN_METADATA = 'plugin.json'[source]
class httk.core.plugins.InstalledPlugin[source]

Describe one installed plugin and its installer metadata.

Parameters:
  • name – Name the installed plugin directory.

  • root – Locate the installed plugin directory.

  • manifest – Provide the parsed plugin.json object.

  • metadata – Provide the parsed plugin.json object.

name: str
root: pathlib.Path
manifest: httk.core.plugins.manifest.PluginManifest
metadata: collections.abc.Mapping[str, object]
httk.core.plugins.installed_plugins()[source]

Read all valid installed plugins.

Returns:

Valid installed plugins in directory-name order.

Return type:

tuple[InstalledPlugin, Ellipsis]

httk.core.plugins.plugin_program(name, program)[source]

Return the absolute path of an installed plugin program.

Parameters:
  • name (str) – Name the installed plugin.

  • program (str) – Name the declared program.

Returns:

The program’s absolute path.

Raises:

ValueError – If the plugin or program is unavailable.

Return type:

pathlib.Path

httk.core.plugins.plugin_root(name)[source]

Return the root of an installed plugin.

Parameters:

name (str) – Name the installed plugin directory.

Returns:

The installed plugin directory.

Raises:

ValueError – If the plugin is not installed.

Return type:

pathlib.Path

httk.core.plugins.plugins_home()[source]

Return the installed plugin directory.

Returns:

The plugin data directory.

Return type:

pathlib.Path

httk.core.plugins.shims_home()[source]

Return the plugin shim directory.

Returns:

The shim data directory.

Return type:

pathlib.Path

class httk.core.plugins.PluginManifest[source]

Describe a validated plugin manifest.

Parameters:
  • name – Name the plugin.

  • description – Describe the plugin, when supplied.

  • templates – Name project-template directories.

  • workflows – Name workflow-package directories.

  • programs – Describe declared utility programs.

  • build – Describe the optional build.

  • root – Locate the parsed plugin directory.

name: str
description: str | None
templates: tuple[str, Ellipsis]
workflows: tuple[str, Ellipsis]
programs: tuple[PluginProgram, Ellipsis]
build: httk.core.building.BuildSpec | None
root: pathlib.Path
class httk.core.plugins.PluginProgram[source]

Describe one declared plugin program.

Parameters:
  • name – Name the program and its shim.

  • file – Name the program member relative to the plugin root.

  • description – Describe the program, when supplied.

name: str
file: str
description: str | None
httk.core.plugins.parse_plugin_manifest(directory)[source]

Parse and validate one plugin manifest.

Parameters:

directory (pathlib.Path) – Locate the plugin directory.

Returns:

The validated plugin manifest.

Raises:

ValueError – If the plugin directory or manifest is malformed.

Return type:

PluginManifest