提交 e36ed05c 编写于 作者: Z zhangjun

add VERSION_TAG for comile python wheel

上级 1cab575a
...@@ -60,6 +60,13 @@ option(WITH_TRT "Compile Paddle Serving with TRT" ...@@ -60,6 +60,13 @@ option(WITH_TRT "Compile Paddle Serving with TRT"
option(PADDLE_ON_INFERENCE "Compile for encryption" ON) option(PADDLE_ON_INFERENCE "Compile for encryption" ON)
option(WITH_OPENCV "Compile Paddle Serving with OPENCV" OFF) option(WITH_OPENCV "Compile Paddle Serving with OPENCV" OFF)
if(NOT DEFINED VERSION_TAG)
set(VERSION_TAG "0.0.0")
endif()
if (WITH_PYTHON)
message(STATUS "Compile Version Tag for wheel: ${VERSION_TAG}")
endif()
if (WITH_OPENCV) if (WITH_OPENCV)
SET(OPENCV_DIR "" CACHE PATH "Location of libraries") SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
if(NOT DEFINED OPENCV_DIR) if(NOT DEFINED OPENCV_DIR)
......
...@@ -47,3 +47,5 @@ elif package_name.endswith('xpu'): ...@@ -47,3 +47,5 @@ elif package_name.endswith('xpu'):
path = "paddle_serving_" + sys.argv[1] path = "paddle_serving_" + sys.argv[1]
commit_id = subprocess.check_output(['git', 'rev-parse', 'HEAD']) commit_id = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
update_info(path + "/version.py", "commit_id", commit_id) update_info(path + "/version.py", "commit_id", commit_id)
update_info(path + "/version.py", "version_tag", "${VERSION_TAG}")
...@@ -12,3 +12,6 @@ ...@@ -12,3 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .models import ServingModels from .models import ServingModels
from . import version
__version__ = version.version_tag
...@@ -12,5 +12,5 @@ ...@@ -12,5 +12,5 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Paddle Serving App version string """ """ Paddle Serving App version string """
serving_app_version = "0.0.0" version = "0.0.0"
commit_id = "" commit_id = ""
...@@ -17,4 +17,4 @@ from . import version ...@@ -17,4 +17,4 @@ from . import version
from . import client from . import client
from .client import * from .client import *
__version__ = version.serving_client_version __version__ = version.version_tag
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Paddle Serving Client version string """ """ Paddle Serving Client version string """
serving_client_version = "0.0.0" version_tag = "0.0.0"
serving_server_version = "0.0.0"
module_proto_version = "0.0.0" module_proto_version = "0.0.0"
commit_id = "" commit_id = ""
...@@ -31,4 +31,4 @@ from paddle_serving_server import ( ...@@ -31,4 +31,4 @@ from paddle_serving_server import (
from .dag import * from .dag import *
from .server import * from .server import *
__version__ = version.serving_server_version __version__ = version.version_tag
...@@ -22,7 +22,7 @@ from .proto import general_model_config_pb2 as m_config ...@@ -22,7 +22,7 @@ from .proto import general_model_config_pb2 as m_config
from .proto import multi_lang_general_model_service_pb2_grpc from .proto import multi_lang_general_model_service_pb2_grpc
import google.protobuf.text_format import google.protobuf.text_format
import time import time
from .version import serving_server_version, version_suffix, device_type from .version import version_tag, version_suffix, device_type
from contextlib import closing from contextlib import closing
import argparse import argparse
...@@ -369,7 +369,7 @@ class Server(object): ...@@ -369,7 +369,7 @@ class Server(object):
version_file = open("{}/version.py".format(self.module_path), "r") version_file = open("{}/version.py".format(self.module_path), "r")
folder_name = "serving-%s-%s" % (self.get_serving_bin_name(), folder_name = "serving-%s-%s" % (self.get_serving_bin_name(),
serving_server_version) version_tag)
tar_name = "%s.tar.gz" % folder_name tar_name = "%s.tar.gz" % folder_name
bin_url = "https://paddle-serving.bj.bcebos.com/bin/%s" % tar_name bin_url = "https://paddle-serving.bj.bcebos.com/bin/%s" % tar_name
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
""" Paddle Serving Server version string """ """ Paddle Serving Server version string """
serving_client_version = "0.0.0" version_tag = "0.0.0"
serving_server_version = "0.0.0"
module_proto_version = "0.0.0"
version_suffix = "" version_suffix = ""
module_proto_version = "0.0.0"
device_type = "0" device_type = "0"
cuda_version = "9" cuda_version = "9"
commit_id = "" commit_id = ""
...@@ -22,7 +22,7 @@ import os ...@@ -22,7 +22,7 @@ import os
from setuptools import setup, Distribution, Extension from setuptools import setup, Distribution, Extension
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
from paddle_serving_app.version import serving_app_version from paddle_serving_app.version import version_tag
from pkg_resources import DistributionNotFound, get_distribution from pkg_resources import DistributionNotFound, get_distribution
def python_version(): def python_version():
...@@ -78,7 +78,7 @@ package_dir={'paddle_serving_app': ...@@ -78,7 +78,7 @@ package_dir={'paddle_serving_app':
setup( setup(
name='paddle-serving-app', name='paddle-serving-app',
version=serving_app_version.replace('-', ''), version=version_tag.replace('-', ''),
description= description=
('Paddle Serving Package for saved model with PaddlePaddle'), ('Paddle Serving Package for saved model with PaddlePaddle'),
url='https://github.com/PaddlePaddle/Serving', url='https://github.com/PaddlePaddle/Serving',
......
...@@ -22,7 +22,7 @@ import sys ...@@ -22,7 +22,7 @@ import sys
from setuptools import setup, Distribution, Extension from setuptools import setup, Distribution, Extension
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
from paddle_serving_client.version import serving_client_version from paddle_serving_client.version import version_tag
import util import util
py_version = sys.version_info py_version = sys.version_info
...@@ -79,7 +79,7 @@ package_dir={'paddle_serving_client': ...@@ -79,7 +79,7 @@ package_dir={'paddle_serving_client':
setup( setup(
name='paddle-serving-client', name='paddle-serving-client',
version=serving_client_version.replace('-', ''), version=version_tag.replace('-', ''),
description= description=
('Paddle Serving Package for saved model with PaddlePaddle'), ('Paddle Serving Package for saved model with PaddlePaddle'),
url='https://github.com/PaddlePaddle/Serving', url='https://github.com/PaddlePaddle/Serving',
......
...@@ -19,7 +19,7 @@ from __future__ import print_function ...@@ -19,7 +19,7 @@ from __future__ import print_function
from setuptools import setup, Distribution, Extension from setuptools import setup, Distribution, Extension
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
from paddle_serving.version import serving_client_version from paddle_serving.version import version_tag
from grpc_tools import protoc from grpc_tools import protoc
import util import util
...@@ -43,7 +43,7 @@ package_dir={'paddle_serving.serving_client': ...@@ -43,7 +43,7 @@ package_dir={'paddle_serving.serving_client':
setup( setup(
name='paddle-serving-client', name='paddle-serving-client',
version=serving_client_version.replace('-', ''), version=version_tag.replace('-', ''),
description= description=
('Paddle Serving Package for saved model with PaddlePaddle'), ('Paddle Serving Package for saved model with PaddlePaddle'),
url='https://github.com/PaddlePaddle/Serving', url='https://github.com/PaddlePaddle/Serving',
......
...@@ -19,10 +19,10 @@ from __future__ import print_function ...@@ -19,10 +19,10 @@ from __future__ import print_function
from setuptools import setup, Distribution, Extension from setuptools import setup, Distribution, Extension
from setuptools import find_packages from setuptools import find_packages
from setuptools import setup from setuptools import setup
from paddle_serving_server.version import serving_server_version, version_suffix from paddle_serving_server.version import version_tag, version_suffix
import util import util
package_version = serving_server_version.replace('-', '') package_version = version_tag.replace('-', '')
if version_suffix != "": if version_suffix != "":
version_suffix = "post" + version_suffix version_suffix = "post" + version_suffix
package_version = package_version + "." + version_suffix package_version = package_version + "." + version_suffix
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册