Skip to content

Commit

Permalink
Revert "Switch requirements to PEP440 direct references"
Browse files Browse the repository at this point in the history
This reverts commit 5334f0d.

ref #3080 (comment)

Signed-off-by: ddelange <[email protected]>
  • Loading branch information
ddelange committed Jun 26, 2023
1 parent 5334f0d commit 92791a9
Showing 1 changed file with 15 additions and 40 deletions.
55 changes: 15 additions & 40 deletions python/packaging/frontend_sdist/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import platform
import sys

from setuptools import setup

tensorrt_module = "##TENSORRT_MODULE##"
tensorrt_version = "##TENSORRT_PYTHON_VERSION##"
index_url = "https://pypi.nvidia.com"

# cherry-pick information from `packaging.markers.default_environment()` needed to find the right wheel
# https://github.com/pypa/packaging/blob/23.1/src/packaging/markers.py#L175-L190
if sys.platform == "linux":
platform_marker = "manylinux_2_17"
else:
raise RuntimeError("TensorRT currently only builds wheels for linux")

if sys.implementation.name == "cpython":
implementation_marker = "cp{}".format("".join(platform.python_version_tuple()[:2]))
else:
raise RuntimeError("TensorRT currently only builds wheels for CPython")

machine_marker = platform.machine()
if machine_marker != "x86_64":
raise RuntimeError("TensorRT currently only builds wheels for x86_64 processors")

libs_wheel = "{}/{}-libs/{}_libs-{}-py2.py3-none-{}_{}.whl".format(
index_url,
tensorrt_module,
tensorrt_module,
tensorrt_version,
platform_marker,
machine_marker,
)
bindings_wheel = "{}/{}-bindings/{}_bindings-{}-{}-none-{}_{}.whl".format(
index_url,
tensorrt_module,
tensorrt_module,
tensorrt_version,
implementation_marker,
platform_marker,
machine_marker,
)

setup(
name=tensorrt_module,
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
To install, please execute the following:
```
pip install tensorrt --extra-index-url https://pypi.nvidia.com
```
Or put the index URL in the (comma-separated) PIP_EXTRA_INDEX_URL environment variable:
```
export PIP_EXTRA_INDEX_URL=https://pypi.nvidia.com
pip install tensorrt
```
""",
long_description_content_type="text/markdown",
author="NVIDIA Corporation",
license="Proprietary",
classifiers=[
Expand All @@ -71,10 +47,9 @@
],
packages=[tensorrt_module],
install_requires=[
"{}_libs @ {}".format(tensorrt_module, libs_wheel),
"{}_bindings @ {}".format(tensorrt_module, bindings_wheel),
"{}_libs=={}".format(tensorrt_module, tensorrt_version),
"{}_bindings=={}".format(tensorrt_module, tensorrt_version),
],
python_requires=">=3.6", # ref https://pypi.nvidia.com/tensorrt-bindings/
extras_require={"numpy": "numpy"},
package_data={tensorrt_module: ["*.so*", "*.pyd", "*.pdb"]},
include_package_data=True,
Expand Down

0 comments on commit 92791a9

Please sign in to comment.