Skip to content

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