From d28d9e704a676dbf179520230be06f7a9c2b3cde Mon Sep 17 00:00:00 2001 From: Zhang Jun Date: Mon, 25 Mar 2024 17:21:10 +0800 Subject: [PATCH] get version by matchiing, so will not need to setup complex env in github aciton --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8aa49bd4ca..4c24734c31 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,14 @@ from setuptools import setup from io import open -from paddleocr import VERSION +import sys +import subprocess + +# get version by matchiing, so will not need to setup complex env in github aciton +p = subprocess.Popen("grep ^VERSION ./paddleocr.py | cut -d\\' -f 2", stdout=subprocess.PIPE, + stderr=subprocess.PIPE, shell=True) +raw_VERSION, _ = p.communicate() +VERSION = raw_VERSION.decode().strip() def load_requirements(file_list=None): if file_list is None: