-
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(rapidocr_api): Optim auto package logic
- Loading branch information
Showing
2 changed files
with
32 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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='[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", | ||
], | ||
}, | ||
) |