From 81675a6b2823da0ec5b67feda130bb0e8e5b2d49 Mon Sep 17 00:00:00 2001 From: Andrey Stotskiy Date: Tue, 26 Oct 2021 19:18:54 +0300 Subject: [PATCH] move the version to setup.py Signed-off-by: Andrey Stotskiy --- onnx_tensorrt/__init__.py | 8 +++++++- setup.py | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/onnx_tensorrt/__init__.py b/onnx_tensorrt/__init__.py index e241103d..908c4eef 100644 --- a/onnx_tensorrt/__init__.py +++ b/onnx_tensorrt/__init__.py @@ -2,6 +2,12 @@ from __future__ import absolute_import +import pkg_resources + from . import backend -__version__ = "8.2.1" +try: + # The version is defined in setup.py + __version__ = pkg_resources.require("onnx_tensorrt")[0].version +except pkg_resources.DistributionNotFound: + __version__ = None diff --git a/setup.py b/setup.py index ad101a93..e79f11df 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ import os import sys -import onnx_tensorrt from setuptools import setup, find_packages def no_publish(): @@ -22,7 +21,7 @@ def main(): no_publish() setup( name="onnx_tensorrt", - version=onnx_tensorrt.__version__, + version="8.2.1", description="ONNX-TensorRT - TensorRT backend for running ONNX models", long_description=open("README.md", "r", encoding="utf-8").read(), url="https://github.com/onnx/onnx-tensorrt",