#2097 Option to exclude dependencies from pex file
Issue created by
JoostvDoorn
Pex currently relies on Pip to resolve dependencies and build the PEX file. However, there are cases where users may want to exclude certain packages, either because they are already available on the target environment or because they are too large to include in the PEX file.
The proposed solution is to add an exclude flag to Pex, which would allow users to specify a list of packages to exclude from the PEX file. During the assembly phase, Pex would exclude these packages and their transitive dependencies, resulting in a smaller PEX file.
I believe this would be a useful feature for many users. We would want to use it with Pants to exclude dependencies such as pyspark for an environment that includes pyspark already.
This issue follows up on the comment here:
#2082 (comment)
Other related issues have been filed previously in pants and pex as well.
#1146 pantsbuild/pants#11324
pantsbuild/pex