Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
90 lines (77 loc) · 2.67 KB
/
Copy pathsetup.py
File metadata and controls
90 lines (77 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
"""
Package installation setup
"""
import os
from pathlib import Path
import subprocess
from setuptools import find_packages, setup
version = "0.1.2a0"
sha = 'Unknown'
package_name = 'doctr'
cwd = Path(__file__).parent.absolute()
if os.getenv('BUILD_VERSION'):
version = os.getenv('BUILD_VERSION')
elif sha != 'Unknown':
try:
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
except Exception:
pass
version += '+' + sha[:7]
print(f"Building wheel {package_name}-{version}")
with open(cwd.joinpath(package_name, 'version.py'), 'w') as f:
f.write(f"__version__ = '{version}'\n")
with open('README.md', 'r') as f:
readme = f.read()
requirements = [
"numpy>=1.16.0",
"scipy>=1.4.0",
"opencv-python>=4.2",
"tensorflow>=2.3.0",
"PyMuPDF>=1.16.0,<1.18.11",
"pyclipper>=1.2.0",
"shapely>=1.6.0",
"matplotlib>=3.1.0",
"mplcursors>=0.3",
"rapidfuzz>=1.0.0",
"weasyprint>=52.2",
]
setup(
# Metadata
name=os.getenv('PKG_INDEX') if os.getenv('PKG_INDEX') else package_name,
version=version,
author='François-Guillaume Fernandez, Charles Gaillard',
author_email='fg@mindee.co',
description='Extract valuable text information from your documents',
long_description=readme,
long_description_content_type="text/markdown",
url='https://github.com/mindee/doctr',
download_url='https://github.com/mindee/doctr/tags',
license='Apache',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords=['ocr', 'deep learning', 'tensorflow', 'text detection', 'text recognition'],
# Package info
packages=find_packages(exclude=('test',)),
zip_safe=True,
python_requires='>=3.6.0',
include_package_data=True,
install_requires=requirements,
package_data={'': ['LICENSE']}
)