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