Skip to content

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になります。