Custom metadata hook¶カスタムメタデータフック¶
This is a custom class in a given Python file that inherits from the MetadataHookInterface.これは、MetadataHookInterfaceから継承される特定のPythonファイル内のカスタムクラスです。
Configuration¶設定¶
The metadata hook plugin name is custom.メタデータフックプラグイン名はcustomです。
[tool.hatch.metadata.hooks.custom]
[metadata.hooks.custom]
Options¶オプション¶
| Optionオプション | Defaultデフォルト | Description説明 |
|---|---|---|
pathpath | hatch_build.pyhatch_build.py | The path of the Python filePythonファイルのパス |
Example¶例¶
from hatchling.metadata.plugin.interface import MetadataHookInterface
class CustomMetadataHook(MetadataHookInterface):
...
If multiple subclasses are found, you must define a function named get_metadata_hook that returns the desired build hook.複数のサブクラスが見つかった場合は、目的のビルドフックを返すget_metadata_hookという名前の関数を定義する必要があります。
Note注意
Any defined PLUGIN_NAME is ignored and will always be custom.定義されたPLUGIN_NAMEは無視され、常にcustomになります。