Skip to content

Commit

Permalink
Fix sdist installation
Browse files Browse the repository at this point in the history
Signed-off-by: ddelange <14880945+ddelange@users.noreply.github.com>
  • Loading branch information
ddelange committed Jun 22, 2023
1 parent 6e5bebd commit 8f412dd
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions python/packaging/frontend_sdist/setup.py
Expand Up @@ -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=[
Expand All @@ -59,12 +35,15 @@ 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,
zip_safe=True,
keywords="nvidia tensorrt deeplearning inference",
url="https://developer.nvidia.com/tensorrt",
download_url="https://github.com/nvidia/tensorrt/tags",
cmdclass={"install": InstallCommand},
)

0 comments on commit 8f412dd

Please sign in to comment.