alert-psychiatrist-14102
08/20/2023, 8:31 AMtorch==1.13.1; platform_system == "Linux" --index-url <https://download.pytorch.org/whl/cu116>
torchvision==0.14.1+cu116; platform_system == "Linux" --index-url <https://download.pytorch.org/whl/cu116>
torch==1.13.1; platform_system == "Darwin"
torchvision==0.14.1; platform_system == "Darwin"
but when running pants generate-lockfiles the --index-url is ignored.
On the other hand, if i were to add the index globally via pants.toml , the macos installation breaks, because for some reasons the torch in https://download.pytorch.org/whl/cu116 is not compatible with macos.
any ideas how I would solve this?gorgeous-winter-99296
08/20/2023, 8:35 AMalert-psychiatrist-14102
08/20/2023, 8:37 AMpython_sources / python_tests macros?gorgeous-winter-99296
08/20/2023, 8:40 AM__defaults__ to automate it, but in effect yes.
# src/py/BUILD
__defaults__(
{
python_source: dict(resolve=parametrize("cpu", "gpu", "reqs")),
python_sources: dict(resolve=parametrize("cpu", "gpu", "reqs")),
}
)
We also have CLI aliases to help make this more ergonomic:
# pants.toml
[cli.alias]
run-gpu = "--python-default-resolve=gpu run"
run-cpu = "--python-default-resolve=cpu run"gorgeous-winter-99296
08/20/2023, 8:42 AMalert-psychiatrist-14102
08/20/2023, 8:47 AM