コード例 #1
0
 def create_tgt(*,
                script: str | None = None,
                entry_point: str | None = None) -> PexBinary:
     return PexBinary(
         {
             PexScriptField.alias: script,
             PexEntryPointField.alias: entry_point
         },
         Address("", target_name="t"),
     )
コード例 #2
0
 def gen_pex_binary_tgt(entry_point: str,
                        tags: list[str] | None = None) -> PexBinary:
     return PexBinary(
         {
             PexEntryPointField.alias: entry_point,
             Tags.alias: tags
         },
         Address("src/py",
                 target_name="pexes",
                 generated_name=entry_point.replace(":", "-")),
         residence_dir="src/py",
     )
コード例 #3
0
 def create_pex_binary(entry_point_spec: str) -> PexBinary:
     return PexBinary(
         {
             PexEntryPointField.alias: entry_point_spec,
             **request.template,
             # Note that overrides comes last to make sure that it indeed overrides.
             **overrides.pop(entry_point_spec, {}),
         },
         # ":" is a forbidden character in target names
         generator_addr.create_generated(entry_point_spec.replace(":", "-")),
         union_membership,
         residence_dir=generator_addr.spec_path,
     )