cold-soccer-63228
06/05/2023, 8:47 PMBUILD
file like follows in every directory.
python_sources(
name="package_config",
sources=[
"_package_config.py",
],
)
python_sources()
Each directory containing a BUILD
file with the package_config
target name contains a corresponding _package_config.py
file.
My dependency inference rule (simplified) does something along the lines of this.
@rule(desc="...")
async def infer_dependencies(
request: InferPackageConfigDependenciesRequest
) -> InferredDependencies:
return InferredDependencies([Address("path/to/directory:package_config")])
I’m getting the following error when running ./pants dependees …
ResolveError: Directory 'path/to/directory:package_config' does not contain any BUILD files.
Is there a way to write my plugin such that it knows that I’m referring to a python_sources
target, and not a directory?curved-television-6568
06/05/2023, 8:52 PMpath/to/directory/BUILD
file, so, where is your python_sources target defined?cold-soccer-63228
06/05/2023, 8:53 PMpath/to/directory:package_config
to the Address
constructor, and path/to/directory:package_config
is a target defined in path/to/directory/BUILD
curved-television-6568
06/05/2023, 8:54 PMAddress("path/to/directory:package_config")
should be Address("path/to/directory", target_name="package_config")
cold-soccer-63228
06/05/2023, 8:54 PM