Skip to content

Commit

Permalink
switch opencv-python to opencv-python-headless #224
Browse files Browse the repository at this point in the history
  • Loading branch information
dothinking committed Jan 22, 2024
1 parent 2273b41 commit e317334
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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"),
Expand All @@ -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,
Expand Down

0 comments on commit e317334

Please sign in to comment.