Skip to content

Custom environment collector


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

Configuration

環境コレクタのプラグイン名はcustomです。

[tool.hatch.env.collectors.custom]
[env.collectors.custom]

Options

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

Example

    from hatch.env.collectors.plugin.interface import EnvironmentCollectorInterface


    class CustomEnvironmentCollector(EnvironmentCollectorInterface):
        ...

複数のサブクラスが見つかった場合は、目的の環境コレクタを返すget_environment_collectorという名前の関数を定義する必要があります。

Note

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