httk.core.plugins.installed

Read installed httk plugins.

Attributes

Classes

PluginManifest

Describe a validated plugin manifest.

PluginProgram

Describe one declared plugin program.

InstalledPlugin

Describe one installed plugin and its installer metadata.

Functions

parse_plugin_manifest(directory)

Parse and validate one plugin manifest.

plugins_home()

Return the installed plugin directory.

shims_home()

Return the plugin shim directory.

installed_plugins()

Read all valid installed plugins.

plugin_root(name)

Return the root of an installed plugin.

plugin_program(name, program)

Return the absolute path of an installed plugin program.

Module Contents

httk.core.plugins.installed.PLUGIN_MANIFEST = 'httk_plugin.toml'[source]
class httk.core.plugins.installed.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.installed.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.installed.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

httk.core.plugins.installed.PLUGIN_METADATA = 'plugin.json'[source]
class httk.core.plugins.installed.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[source]
root: pathlib.Path[source]
manifest: httk.core.plugins.manifest.PluginManifest[source]
metadata: collections.abc.Mapping[str, object][source]
httk.core.plugins.installed.plugins_home()[source]

Return the installed plugin directory.

Returns:

The plugin data directory.

Return type:

pathlib.Path

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

Return the plugin shim directory.

Returns:

The shim data directory.

Return type:

pathlib.Path

httk.core.plugins.installed.installed_plugins()[source]

Read all valid installed plugins.

Returns:

Valid installed plugins in directory-name order.

Return type:

tuple[InstalledPlugin, Ellipsis]

httk.core.plugins.installed.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.installed.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