mirror of
https://github.com/RapidAI/RapidOCR.git
synced 2026-11-14 06:50:48 +08:00
Add visualize paramter of rapid-table module.
This commit is contained in:
1 parent
a87133a6fc
commit
0bddb01f9a
9 files changed
+96
-41
No files matched your search
@@ -1,7 +1,9 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
# @Author: SWHL
|
||||
# @Contact: liekkaskono@163.com
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import setuptools
|
||||
@@ -12,8 +14,7 @@ def get_latest_version(package_name):
|
||||
capture_output=True)
|
||||
output = output.stdout.decode('utf-8')
|
||||
if output:
|
||||
output = list(filter(lambda x: len(x) > 0, output.split('\n')))
|
||||
return output[0].strip().split(' ')[-1][1:-1]
|
||||
return extract_version(output)
|
||||
return None
|
||||
|
||||
|
||||
@@ -35,10 +36,26 @@ def get_readme():
|
||||
return readme
|
||||
|
||||
|
||||
def extract_version(message: str) -> str:
|
||||
pattern = r'\d+\.(?:\d+\.)*\d+'
|
||||
matched_versions = re.findall(pattern, message)
|
||||
if matched_versions:
|
||||
return matched_versions[0]
|
||||
return ''
|
||||
|
||||
|
||||
MODULE_NAME = 'rapid_layout'
|
||||
latest_version = get_latest_version(MODULE_NAME)
|
||||
VERSION_NUM = version_add_one(latest_version)
|
||||
|
||||
# 优先提取commit message中的语义化版本号,如无,则自动加1
|
||||
if len(sys.argv) > 2:
|
||||
match_str = ' '.join(sys.argv[2:])
|
||||
matched_versions = extract_version(match_str)
|
||||
if matched_versions:
|
||||
VERSION_NUM = matched_versions
|
||||
sys.argv = sys.argv[:2]
|
||||
|
||||
setuptools.setup(
|
||||
name=MODULE_NAME,
|
||||
version=VERSION_NUM,
|
||||
|
||||
Reference in new issue
Block a user