Skip to content

πŸ“„ Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.

ci(rapidocr_api): Optim auto package logic

SWHL7238dc1f8e90
diff --git a/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml b/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml
index e02554d..c2c6779 100644
--- a/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml
+++ b/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml
@@ -38,14 +38,7 @@ jobs:
pip install get_pypi_latest_version wheel
python -m pip install --upgrade pip
- python setup.py bdist_wheel ${{ github.event.head_commit.message }}
-
- # - name: Publish distribution πŸ“¦ to Test PyPI
- # uses: pypa/[email protected]
- # with:
- # password: ${{ secrets.TEST_PYPI_API_TOKEN }}
- # repository_url: https://test.pypi.org/legacy/
- # packages_dir: ocrweb/dist/
+ python setup.py bdist_wheel "${{ github.event.head_commit.message }}"
- name: Publish distribution πŸ“¦ to PyPI
uses: pypa/[email protected]
diff --git a/api/setup.py b/api/setup.py
index 6bee5bf..54e6df1 100644
--- a/api/setup.py
+++ b/api/setup.py
@@ -10,23 +10,23 @@ from get_pypi_latest_version import GetPyPiLatestVersion
def get_readme():
root_dir = Path(__file__).resolve().parent.parent
- readme_path = str(root_dir / 'docs' / 'doc_whl_rapidocr_api.md')
- with open(readme_path, 'r', encoding='utf-8') as f:
+ readme_path = str(root_dir / "docs" / "doc_whl_rapidocr_api.md")
+ with open(readme_path, "r", encoding="utf-8") as f:
readme = f.read()
return readme
-MODULE_NAME = 'rapidocr_api'
+MODULE_NAME = "rapidocr_api"
obtainer = GetPyPiLatestVersion()
try:
latest_version = obtainer(MODULE_NAME)
except ValueError:
- latest_version = '0.0.0'
+ latest_version = "0.0.0"
VERSION_NUM = obtainer.version_add_one(latest_version)
if len(sys.argv) > 2:
- match_str = ' '.join(sys.argv[2:])
+ match_str = " ".join(sys.argv[2:])
matched_versions = obtainer.extract_version(match_str)
if matched_versions:
VERSION_NUM = matched_versions
@@ -35,35 +35,40 @@ sys.argv = sys.argv[:2]
setuptools.setup(
name=MODULE_NAME,
version=VERSION_NUM,
- platforms='Any',
- description='A cross platform OCR API Library based on OnnxRuntime.',
+ platforms="Any",
+ description="A cross platform OCR API Library based on OnnxRuntime.",
long_description=get_readme(),
- long_description_content_type='text/markdown',
- author='SWHL',
- author_email='[email protected]',
- url='https://github.com/RapidAI/RapidOCR',
- download_url='https://github.com/RapidAI/RapidOCR.git',
- license='Apache-2.0',
+ long_description_content_type="text/markdown",
+ author="SWHL",
+ author_email="[email protected]",
+ url="https://github.com/RapidAI/RapidOCR",
+ download_url="https://github.com/RapidAI/RapidOCR.git",
+ license="Apache-2.0",
include_package_data=True,
- install_requires=['requests', 'rapidocr_onnxruntime',
- 'fastapi', 'uvicorn[standard]'],
+ install_requires=[
+ "requests",
+ "rapidocr_onnxruntime",
+ "fastapi",
+ "uvicorn[standard]",
+ ],
packages=[MODULE_NAME],
- package_data={'': ['*.ico', '*.css', '*.js', '*.html']},
+ package_data={"": ["*.ico", "*.css", "*.js", "*.html"]},
keywords=[
- 'ocr,text_detection,text_recognition,db,onnxruntime,paddleocr,openvino,rapidocr'
+ "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',
+ "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",
+ "Programming Language :: Python :: 3.12",
],
- python_requires='>=3.6,<3.12',
+ python_requires=">=3.6,<3.13",
entry_points={
- 'console_scripts': [
- f'{MODULE_NAME}={MODULE_NAME}.api:main',
+ "console_scripts": [
+ f"{MODULE_NAME}={MODULE_NAME}.api:main",
],
},
)