I am creating a Python package that depends on PyTorch. PyTorch's installation command is as follows (from https://pytorch.org/):
pip3 install torch==1.8.2+cu102 torchvision==0.9.2+cu102 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
Question 1: How should I prepare setup.py?
I read this Equivalent for `--find-links` in `setup.py` where it says we could add the link into dependency_links
list, but this is no longer supported since 2019.
Question 2: How to programatically decide which version to install? (CPU, GPU, CUDA version)
The command above is for a GPU-enabled machine with CUDA 10.2. But if the machine doesn't have GPU, one would use:
pip3 install torch==1.8.2+cpu torchvision==0.9.2+cpu torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
Is it possible for my package's setup.py to automatically identify the user's system and modify the install_requires
list accordingly?