Add platform markers for linux only extra_install_requires (#88826)

Fixes #88049

https://github.com/pytorch/pytorch/pull/85097 added new extra dependencies on `nvidia-*`. They are linux (GPU) only packages, but were not marked as such, causing issues installing pytorch 1.13 via Poetry (and possibly other tools that follow PyPI's metadata API) on non-Linux systems. This "fixes" the issue by adding the `; platform_system = 'Linux'` marker on these dependencies, but the main problem of different metadata for different wheels is a [somewhat larger issue](https://github.com/pytorch/pytorch/issues/88049#issuecomment-1302555269).

https://github.com/pytorch/pytorch/pull/85097 used `;` as a delimiter for splitting the different deps, but that is the delimiter used in markers, so I changed to split on `|`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/88826
Approved by: https://github.com/neersighted, https://github.com/lalmei, https://github.com/malfet
This commit is contained in:
Jacob Hayes
2022-11-18 14:09:21 +00:00
committed by PyTorch MergeBot
parent 5654fed23e
commit 2e358cc98f
3 changed files with 9 additions and 9 deletions

View File

@ -852,7 +852,7 @@ def configure_extension_build():
pytorch_extra_install_requirements = os.getenv("PYTORCH_EXTRA_INSTALL_REQUIREMENTS", "")
if pytorch_extra_install_requirements:
report(f"pytorch_extra_install_requirements: {pytorch_extra_install_requirements}")
extra_install_requires += pytorch_extra_install_requirements.split(";")
extra_install_requires += pytorch_extra_install_requirements.split("|")
# Cross-compile for M1