I have tried listing the following dependency in pyproject.toml
to have this particular torch
only be installed when on Windows platforms.
torch = { url = "https://download.pytorch.org/whl/cpu/torch-1.7.0%2Bcpu-cp36-cp36m-win_amd64.whl", platform = "windows"}
torch = { url = "https://download.pytorch.org/whl/cpu/torch-1.7.0%2Bcpu-cp36-cp36m-win_amd64.whl", markers = "sys_platform == 'win32'"}
Regardless, poetry attempts to install it on macOS and linux, causing an error.
EnvCommandError
Command ['/home/runner/work/.../.venv/bin/pip', 'install', '--no-deps', '/home/runner/.cache/pypoetry/artifacts/00/91/70/1f0b4cacc2e27f6d54a1d33fccf09212bb25b7559f2e5ee8f457902ed6/torch-1.7.0+cpu-cp36-cp36m-win_amd64.whl'] errored with the following return code 1, and output:
ERROR: torch-1.7.0+cpu-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
How can torch
be listed so that it only installs on Windows platforms?