hatch.publish.plugin.interface.PublisherInterface¶
- class hatch.publish.plugin.interface.PublisherInterface(app, root, cache_dir, project_config, plugin_config)¶
Bases:
ABC
Example usage:
- ```python tab=”plugin.py”
from hatch.publish.plugin.interface import PublisherInterface
- class SpecialPublisher(PublisherInterface):
PLUGIN_NAME = ‘special’ …
- ```python tab=”hooks.py”
from hatchling.plugin import hookimpl
from .plugin import SpecialPublisher
@hookimpl def hatch_register_publisher():
return SpecialPublisher
- __init__(app, root, cache_dir, project_config, plugin_config)¶
Methods
__init__
(app, root, cache_dir, ...)publish
(artifacts, options)Attributes
The name used for selection.
An instance of [Application](../utilities.md#hatchling.bridge.app.Application).
The directory reserved exclusively for this plugin as a path-like object.
Whether this plugin is disabled, thus requiring confirmation when publishing.
This is defined in Hatch's [config file](../../config/hatch.md).
`toml config-example [tool.hatch.publish.<PLUGIN_NAME>] `
The root of the project tree as a path-like object.
- PLUGIN_NAME = ''¶
The name used for selection.
- property app¶
An instance of [Application](../utilities.md#hatchling.bridge.app.Application).
- property cache_dir¶
The directory reserved exclusively for this plugin as a path-like object.
- property disable¶
Whether this plugin is disabled, thus requiring confirmation when publishing. Local [project configuration](reference.md#hatch.publish.plugin.interface.PublisherInterface.project_config) takes precedence over global [plugin configuration](reference.md#hatch.publish.plugin.interface.PublisherInterface.plugin_config).
- property plugin_config: dict¶
This is defined in Hatch’s [config file](../../config/hatch.md).
`toml tab="config.toml" [publish.<PLUGIN_NAME>] `
- property project_config: dict¶
`toml config-example [tool.hatch.publish.<PLUGIN_NAME>] `
- abstract publish(artifacts: list[str], options: dict)¶
- Material-align-horizontal-left:
REQUIRED :material-align-horizontal-right:
This is called directly by the [publish](../../cli/reference.md#hatch-publish) command with the arguments and options it receives.
- property root¶
The root of the project tree as a path-like object.