diff --git a/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml b/.github/workflows/gen_whl_to_pypi_rapidocr_api.yml index e02554df4..c2c677958 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/gh-action-pypi-publish@v1.5.0 - # 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/gh-action-pypi-publish@v1.5.0 diff --git a/api/setup.py b/api/setup.py index 6bee5bfc0..54e6df1ce 100644 --- a/api/setup.py +++ b/api/setup.py @@ -10,23 +10,23 @@ 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 @@ def get_readme(): 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='liekkaskono@163.com', - 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="liekkaskono@163.com", + 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", ], }, )