加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.py 2.14 KB
一键复制 编辑 原始数据 按行查看 历史
SWHL 提交于 2023-07-27 09:49 . Update unit test
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: liekkaskono@163.com
import sys
from pathlib import Path
from typing import List
import setuptools
from get_pypi_latest_version import GetPyPiLatestVersion
def read_txt(txt_path: str) -> List:
if not isinstance(txt_path, str):
txt_path = str(txt_path)
with open(txt_path, "r", encoding="utf-8") as f:
data = list(map(lambda x: x.rstrip("\n"), f))
return data
def get_readme():
root_dir = Path(__file__).resolve().parent
readme_path = str(root_dir / "docs" / "docs_whl.md")
with open(readme_path, "r", encoding="utf-8") as f:
readme = f.read()
return readme
MODULE_NAME = "paddleocr_convert"
obtainer = GetPyPiLatestVersion()
latest_version = obtainer(MODULE_NAME)
VERSION_NUM = obtainer.version_add_one(latest_version)
if len(sys.argv) > 2:
match_str = " ".join(sys.argv[2:])
matched_versions = obtainer.extract_version(match_str)
if matched_versions:
VERSION_NUM = matched_versions
sys.argv = sys.argv[:2]
setuptools.setup(
name=MODULE_NAME,
version=VERSION_NUM,
platforms="Any",
description="Tool for converting the PaddleOCR model to onnx format.",
long_description=get_readme(),
long_description_content_type="text/markdown",
author="SWHL",
author_email="liekkaskono@163.com",
url="https://github.com/RapidAI/PaddleOCRModelConverter",
download_url="https://github.com/RapidAI/PaddleOCRModelConverter.git",
license="Apache-2.0",
include_package_data=True,
install_requires=read_txt("requirements.txt"),
packages=[MODULE_NAME],
keywords=[
"ocr,text_detection,text_recognition,db,onnxruntime,paddleocr,openvino,rapidocr"
],
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
python_requires=">=3.6,<3.12",
entry_points={
"console_scripts": [f"{MODULE_NAME}={MODULE_NAME}.main:main"],
},
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化