proud-dentist-22844
03/28/2023, 6:12 PMpex_binary
that gets built based on a set of python_distribution
targets so that the pex includes all of the entry_points metadata. The purpose of this pex is not to run a binary or script (so, entry_point=None
); its purpose is to create a virtualenv from its contents (so, include_tools=True
).
I tried just depending on the python_distribution
targets, but then pants looks at the transitive deps which includes things like a relocated_file(source="LICENSE")
target. Because the python_distribution
has transitive deps that are files
instead of resources
, I get a warning telling me to use resources
instead.
If I use include_sources=False
, I still get the warning about transitive files
targets. Oddly enough, the generated wheels still get installed in the pex, which I guess is fine since they are not sources (they are generated). So, is there a way to prevent the warning for this pex_binary
target? Having that warning on other pex_binary
targets that are meant to be executable is fine. But, in this case, I want an “I know what I’m doing” flag to signal that I expect pex to just use the generated wheels and install whatever the wheel includes, whether or not that wheel happened to somehow include a files
target.
So, is there a way to prevent that warning for a particular pex_binary
target?happy-kitchen-89482
03/28/2023, 6:58 PMhappy-kitchen-89482
03/28/2023, 6:58 PMpex_binary
is needed, because this seems a bit out of scope for what pex_binary
is supposed to beproud-dentist-22844
03/28/2023, 7:22 PMproud-dentist-22844
03/28/2023, 7:24 PMpex_binary
because that’s the canonical way to create a pex in pants, isn’t it?proud-dentist-22844
03/28/2023, 8:12 PMpex_target(include_sources=False)
? Maybe what should happen is:
• if field_set.include_sources: check for files
targets in the transitive dependencies closure
• else (include_sources == False): check for files
targets ONLY in the direct dependencies, since only those will get materialized in the sandbox for pex to use.proud-dentist-22844
03/29/2023, 12:17 AMHow are you generating this virtualenv?
PEX_TOOLS=1 dist/st2.pex venv /opt/stackstorm/st2
happy-kitchen-89482
03/29/2023, 7:07 AMproud-dentist-22844
03/29/2023, 11:54 PMinclude_sources=False
. Wdyt?