From 8f412ddaee9e9a4dd8910e322febb8991c242168 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Thu, 22 Jun 2023 09:01:41 +0200 Subject: [PATCH] Fix sdist installation Signed-off-by: ddelange <14880945+ddelange@users.noreply.github.com> --- python/packaging/frontend_sdist/setup.py | 37 +++++------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/python/packaging/frontend_sdist/setup.py b/python/packaging/frontend_sdist/setup.py index 7d647ffba..fbdae52b0 100644 --- a/python/packaging/frontend_sdist/setup.py +++ b/python/packaging/frontend_sdist/setup.py @@ -15,42 +15,18 @@ # limitations under the License. # -import sys - from setuptools import setup -from setuptools.command.install import install -import subprocess as sp tensorrt_module = "##TENSORRT_MODULE##" - - -class InstallCommand(install): - def run(self): - def install_dep(package_name): - status = sp.run( - [ - sys.executable, - "-m", - "pip", - "install", - "{:}==##TENSORRT_PYTHON_VERSION##".format(package_name), - "--index-url", - "https://pypi.nvidia.com", - ] - ) - status.check_returncode() - - install_dep("{:}_libs".format(tensorrt_module)) - install_dep("{:}_bindings".format(tensorrt_module)) - - install.run(self) +tensorrt_version = "##TENSORRT_PYTHON_VERSION##" setup( name=tensorrt_module, - version="##TENSORRT_PYTHON_VERSION##", + version=tensorrt_version, description="A high performance deep learning inference library", - long_description="A high performance deep learning inference library", + long_description="A high performance deep learning inference library\n\nInstall using `pip install tensorrt --extra-index-url https://pypi.nvidia.com` or run `export PIP_EXTRA_INDEX_URL=https://pypi.nvidia.com` (comma-separated URLs) and then `pip install tensorrt`.", + long_description_content_type="text/markdown", author="NVIDIA Corporation", license="Proprietary", classifiers=[ @@ -59,6 +35,10 @@ def install_dep(package_name): "Programming Language :: Python :: 3", ], packages=[tensorrt_module], + install_requires=[ + "{}_libs=={}".format(tensorrt_module, tensorrt_version), + "{}_bindings=={}".format(tensorrt_module, tensorrt_version), + ], extras_require={"numpy": "numpy"}, package_data={tensorrt_module: ["*.so*", "*.pyd", "*.pdb"]}, include_package_data=True, @@ -66,5 +46,4 @@ def install_dep(package_name): keywords="nvidia tensorrt deeplearning inference", url="https://developer.nvidia.com/tensorrt", download_url="https://github.com/nvidia/tensorrt/tags", - cmdclass={"install": InstallCommand}, )