careful-address-89803
02/22/2024, 3:35 AMclass Black(PythonToolBase): , if I have Black, can I get an instance black with all of the options filled in? I'm hoping to invoke black.pex_requirements(), but that's an instance methodwide-midnight-78598
02/22/2024, 3:56 AMasync def _run_black(
request: AbstractFmtRequest.Batch,
black: Black,
interpreter_constraints: InterpreterConstraints,
) -> FmtResult:
black_pex_get = Get(
VenvPex,
PexRequest,
black.to_pex_request(interpreter_constraints=interpreter_constraints),careful-address-89803
02/22/2024, 4:01 AM@union
class ExportableTool:
resolve_name: ClassVar[str]
subsystem_cls: ClassVar[type]
class BlackExportableTool(ExportableTool):
resolve_name = Black.options_scope
subsystem_cls = Black
and in a rule I've got an instance of BlackExportableTool and would like to somehow get an instance of blackcareful-address-89803
02/22/2024, 4:02 AMBlack in this casecurved-television-6568
02/22/2024, 9:34 AMGet(Black, {}) but I guess the type is not known statically, no worries, you can leverage https://github.com/pantsbuild/pants/pull/16929 to provide the type dynamically.curved-television-6568
02/22/2024, 9:35 AMcareful-address-89803
03/25/2024, 3:20 AM