Skip to content

Custom metadata hook


これは、MetadataHookInterfaceから継承される特定のPythonファイル内のカスタムクラスです。

Configuration

メタデータフックプラグイン名はcustomです。

[tool.hatch.metadata.hooks.custom]
[metadata.hooks.custom]

Options

Option Default Description
path hatch_build.py The path of the Python file

Example

from hatchling.metadata.plugin.interface import MetadataHookInterface


class CustomMetadataHook(MetadataHookInterface):
    ...

複数のサブクラスが見つかった場合は、目的のビルドフックを返すget_metadata_hookという名前の関数を定義する必要があります。

Note

定義されたPLUGIN_NAMEは無視され、常に「custom」になります。