Skip to content

Commit 5f42262

Browse files
authored
Add platform checks before nested pip call (#3084)
* Add platform checks before nested pip call Signed-off-by: ddelange <[email protected]> * Remove unused variables Signed-off-by: ddelange <[email protected]> * PR Suggestion Signed-off-by: ddelange <[email protected]> --------- Signed-off-by: ddelange <[email protected]>
1 parent e301562 commit 5f42262

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python/packaging/frontend_sdist/setup.py

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#
1717

1818
import os
19+
import platform
1920
import subprocess
2021
import sys
2122

@@ -39,6 +40,15 @@ def run_pip_command(args, call_func):
3940
return call_func([os.path.join(sys.exec_prefix, "bin", "pip")] + args)
4041

4142

43+
# check wheel availability using information from https://github.com/pypa/packaging/blob/23.1/src/packaging/markers.py#L175-L190
44+
if sys.platform not in ("linux", "win32"):
45+
raise RuntimeError("TensorRT currently only builds wheels for Linux and Windows")
46+
if sys.implementation.name != "cpython":
47+
raise RuntimeError("TensorRT currently only builds wheels for CPython")
48+
if platform.machine() not in ("x86_64", "AMD64"):
49+
raise RuntimeError("TensorRT currently only builds wheels for x86_64 processors")
50+
51+
4252
class InstallCommand(install):
4353
def run(self):
4454
# pip-inside-pip hack ref #3080

0 commit comments

Comments
 (0)