From 9742d8d5036c028071e903e8e6f8be7f6337fba6 Mon Sep 17 00:00:00 2001 From: dothinking Date: Sat, 20 Jan 2024 15:42:49 +0800 Subject: [PATCH] switch opencv-python to opencv-python-headless #224 --- requirements.txt | 5 ++--- setup.py | 17 +++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements.txt b/requirements.txt index 14baa2b..87df5f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ -PyMuPDF +PyMuPDF>=1.19.0 python-docx>=0.8.10 fonttools>=4.24.0 numpy>=1.17.2 -opencv-python>=4.5 -# opencv-python-headless>=4.5 +opencv-python-headless>=4.5 fire>=0.3.0 \ No newline at end of file diff --git a/setup.py b/setup.py index b8a96c7..c4c05f9 100644 --- a/setup.py +++ b/setup.py @@ -6,19 +6,18 @@ DESCRIPTION = 'Open source Python library converting pdf to docx.' EXCLUDE_FROM_PACKAGES = ["build", "dist", "test"] -# read version number from version.txt, otherwise alpha version -# Github CI can create version.txt dynamically. + def get_version(fname): + '''Read version number from version.txt, created dynamically per Github Action.''' if os.path.exists(fname): with open(fname, "r", encoding="utf-8") as f: version = f.readline().strip() else: version = '0.5.6a1' - return version -# Load README.md for long description def load_long_description(fname): + '''Load README.md for long description''' if os.path.exists(fname): with open(fname, "r", encoding="utf-8") as f: long_description = f.read() @@ -28,9 +27,10 @@ def load_long_description(fname): return long_description def load_requirements(fname): + '''Load requirements.''' try: # pip >= 10.0 - from pip._internal.req import parse_requirements + from pip._internal.req import parse_requirements except ImportError: # pip < 10.0 from pip.req import parse_requirements @@ -40,9 +40,9 @@ def load_requirements(fname): requirements = [str(ir.requirement) for ir in reqs] except AttributeError: requirements = [str(ir.req) for ir in reqs] - return requirements + setup( name="pdf2docx", version=get_version("version.txt"), @@ -51,8 +51,9 @@ def load_requirements(fname): long_description=load_long_description("README.md"), long_description_content_type="text/markdown", license="GPL v3", - author = 'Artifex', - author_email = 'support@artifex.com', + author='Artifex', + author_email='support@artifex.com', + url='https://artifex.com/', packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES), include_package_data=True, zip_safe=False,