-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
10 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
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 |
---|---|---|
|
@@ -3,11 +3,21 @@ | |
# @Contact: [email protected] | ||
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.parent | ||
readme_path = str(root_dir / "docs" / "doc_whl_rapidocr_api.md") | ||
|
@@ -22,7 +32,7 @@ def get_readme(): | |
try: | ||
latest_version = obtainer(MODULE_NAME) | ||
except ValueError: | ||
latest_version = "0.0.0" | ||
latest_version = "0.0.1" | ||
VERSION_NUM = obtainer.version_add_one(latest_version) | ||
|
||
if len(sys.argv) > 2: | ||
|
@@ -45,12 +55,7 @@ def get_readme(): | |
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=read_txt("requirements.txt"), | ||
packages=[MODULE_NAME], | ||
package_data={"": ["*.ico", "*.css", "*.js", "*.html"]}, | ||
keywords=[ | ||
|
@@ -68,7 +73,7 @@ def get_readme(): | |
python_requires=">=3.6,<3.13", | ||
entry_points={ | ||
"console_scripts": [ | ||
f"{MODULE_NAME}={MODULE_NAME}.api:main", | ||
f"{MODULE_NAME}={MODULE_NAME}.main:main", | ||
], | ||
}, | ||
) |