fresh-continent-76371
04/06/2023, 12:06 AM# project_version/targets.py
from pants.engine.target import COMMON_TARGET_FIELDS, SingleSourceField, Target
class ProjectVersionTarget(Target):
alias = "version_file"
core_fields = (*COMMON_TARGET_FIELDS, SingleSourceField)
help = "A project version target representing the VERSION file."
# project_version/register.py
from typing import Iterable
from pants.engine.target import Target
from project_version.target_types import ProjectVersionTarget <<< incorrect import ?
def target_types() -> Iterable[type[Target]]:
return [ProjectVersionTarget]
the import in the register example
from project_version.target_types import ProjectVersionTarget
should be
from project_version.targets import ProjectVersionTarget
wide-midnight-78598
04/06/2023, 12:50 AMxyz/target_types.py
https://github.com/pantsbuild/pants/search?q=target_types