bitter-ability-32190
11/09/2021, 6:04 PMpex_binaries
-> pex_binary
to mirror python_sources
-> python_source
?curved-television-6568
11/09/2021, 6:05 PMhundreds-father-404
11/09/2021, 6:15 PMbitter-ability-32190
11/09/2021, 6:19 PMpex_binary(
name="deps_commands",
entry_point="deps_commands.py",
)
pex_binary(
name="docker_aws_creds",
entry_point="docker_aws_creds.py",
)
pex_binary(
name="format_commands",
entry_point="format_commands.py",
)
pex_binary(
name="jenkinstrigger",
entry_point="jenkinstrigger.py",
)
pex_binary(
name="pip_integration",
entry_point="pip_integration.py",
)
pex_binary(
name="presubmit_commands",
entry_point="presubmit_commands.py",
)
pex_binary(
name="static_analysis_commands",
entry_point="static_analysis_commands.py",
)
python_tests(
name="tests",
)
python_sources()
Perhaps a stop-gap could be a macro 🤔curved-television-6568
11/09/2021, 6:23 PMhundreds-father-404
11/09/2021, 6:27 PMpex_binaries_from_sources(
sources=[
"static_analysis_commands.py",
"presubmit_commands.py",
...
],
)
That is, this is specifically intended for the pattern pex_binary(name="my_script", entry_point="my_script.py")
. It is not intended for pex_binary(name="black", script="black", dependencies=["//:black")
(i.e. a console script)
That would simplify this a lot, that we don't need to come up with some fancy modeling to gracefully handle both console scripts and entry_point
where the entry_point
is a source filehundreds-father-404
11/09/2021, 6:28 PMhelp
saying "Generates pex_binary
targets". That is, we only have a few targets that are "atoms" of builds, and the rest are just boilerplate reductionbitter-ability-32190
11/09/2021, 6:30 PMtailor
? (Which is what generated the above file)hundreds-father-404
11/09/2021, 6:32 PM[python].tailor_pex_binary_targets
, and then implement your own tailor
implementation with the Plugin API
Although probably better is if we decide to add this to Pants, have ./pants tailor
generate pex_binaries_from_sources
rather than pex_binary
. Note that Pants can only generate that type of PEX anyways. A console-script PEX is (usually) file-less, so we have no way of knowing you want us to generate the targethundreds-father-404
11/09/2021, 6:34 PMpex_binaries_from_sources(
sources=[
"static_analysis_commands.py",
"presubmit_commands.py",
...
],
overrides={
"presubmit_commands.py": {"execution_mode": "venv"},
},
)
bitter-ability-32190
11/09/2021, 6:36 PMhundreds-father-404
11/09/2021, 6:40 PMname=
boilerplate because the target generator would automatically add it for you. I'm thinking this target generator makes sensebitter-ability-32190
11/09/2021, 7:00 PMbitter-ability-32190
11/09/2021, 7:01 PMbusy-vase-39202
11/09/2021, 7:33 PMbitter-ability-32190
11/09/2021, 7:36 PMbitter-ability-32190
11/09/2021, 7:41 PMbusy-vase-39202
11/09/2021, 8:32 PM