hundreds-father-404
05/28/2020, 8:35 PMobject
for contrib_plugin
is that we need access to the target’s relative path (spec path). Does this mean I need to use context_aware_object_factory
?witty-crayon-22786
05/28/2020, 8:41 PMhundreds-father-404
05/28/2020, 8:42 PMwitty-crayon-22786
05/28/2020, 8:42 PMobject
.witty-crayon-22786
05/28/2020, 8:42 PMhundreds-father-404
05/28/2020, 8:43 PMobject
and everything works great, minus needing the spec path. I think CAFO handles this? A CAFO is just a fancy way to create something like an object
, right?witty-crayon-22786
05/28/2020, 8:43 PMwitty-crayon-22786
05/28/2020, 8:44 PMwitty-crayon-22786
05/28/2020, 9:14 PMobjects
) to macro/BUILD file evaluation might satisfy these usecases.hundreds-father-404
05/28/2020, 9:18 PMPath.cwd()
in this contrib_setup_py
object!witty-crayon-22786
05/28/2020, 9:18 PMhundreds-father-404
05/28/2020, 9:19 PMhundreds-father-404
05/28/2020, 9:34 PMdef contrib_setup_py(
parse_context,
name: str,
description: str,
build_file_aliases: bool = False,
global_subsystems: bool = False,
register_goals: bool = False,
rules: bool = False,
target_types: bool = False,
additional_classifiers: Optional[List[str]] = None,
**kwargs,
) -> PythonArtifact:
witty-crayon-22786
05/28/2020, 9:36 PMwitty-crayon-22786
05/28/2020, 9:36 PMwitty-crayon-22786
05/28/2020, 9:38 PMsrc/python/pants/backend/python/python_requirements.py
witty-crayon-22786
05/28/2020, 9:39 PMdef outer(parse_context):
def inner(requirements_relpath="requirements.txt"):
# do things with the parse_context and my args
return inner
witty-crayon-22786
05/28/2020, 9:40 PMhundreds-father-404
05/28/2020, 9:40 PMcontrib_setup_py(arg1=..., arg2=...)
witty-crayon-22786
05/28/2020, 9:40 PMwitty-crayon-22786
05/28/2020, 9:41 PM__call__
in the first case) is effectively directly exposed in the BUILD file.hundreds-father-404
05/28/2020, 9:41 PMhundreds-father-404
05/28/2020, 9:53 PMhundreds-father-404
05/28/2020, 10:01 PM