clean-manchester-83682
02/10/2023, 11:40 PM./pants dependencies sailebot/referral:referral --dependencies-transitive
So i'm able to exclude talon fine, but i want to exclude a dependency that talon depends on.
This works, to exclude talon
python_awslambda(
name="referral",
runtime="python3.7",
handler="referral_lambda.py:lambda_handler",
dependencies=["//:reqs#psycopg2-binary","!!//:reqs#talon"],
)
But this doesn't work
python_awslambda(
name="referral",
runtime="python3.7",
handler="referral_lambda.py:lambda_handler",
dependencies=["//:reqs#psycopg2-binary","!!//:reqs#scipy"],
)
enough-analyst-54434
02/11/2023, 1:11 AMenough-analyst-54434
02/11/2023, 1:12 AMclean-manchester-83682
02/11/2023, 1:54 PMenough-analyst-54434
02/11/2023, 1:56 PMenough-analyst-54434
02/11/2023, 1:58 PMenough-analyst-54434
02/11/2023, 2:02 PMclean-manchester-83682
02/11/2023, 2:03 PMenough-analyst-54434
02/11/2023, 2:03 PMclean-manchester-83682
02/11/2023, 3:45 PMclass InstallCommand(install):
user_options = install.user_options + [
('no-ml', None, "Don't install without Machine Learning modules."),
]
...
for not_required in ["numpy", "scipy", "scikit-learn==0.24.1"]:
dist.install_requires.remove(not_required)
This is what i needed. Is there a way to specify no-ml within pants?enough-analyst-54434
02/11/2023, 3:52 PMtalon[ml]
as a requirement to get ML deps but they would be left off otherwise. All Python tools speak extras. As it is .. I don't think so. You could with Pex, but I believe Pants gets in the way here. With Pex / Pip you use a requirements file that passes the options as documented here: https://pip.pypa.io/en/stable/reference/requirements-file-format/#per-requirement-optionsenough-analyst-54434
02/11/2023, 3:54 PMtalon --install-option=no-ml
enough-analyst-54434
02/11/2023, 3:55 PM