2015-07-25 23:45:13 -07:00
|
|
|
#!/usr/bin/env python3
|
2016-02-05 02:34:49 -08:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-07-28 04:36:58 -07:00
|
|
|
# © 2015 James R. Barlow: github.com/jbarlow83
|
2018-03-14 14:40:48 -07:00
|
|
|
#
|
|
|
|
# This file is part of OCRmyPDF.
|
|
|
|
#
|
|
|
|
# OCRmyPDF is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# OCRmyPDF is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with OCRmyPDF. If not, see <http://www.gnu.org/licenses/>.
|
2015-07-25 23:45:13 -07:00
|
|
|
|
2015-12-21 09:38:38 -08:00
|
|
|
from __future__ import print_function, unicode_literals
|
2015-07-27 01:45:17 -07:00
|
|
|
|
2016-02-05 02:34:49 -08:00
|
|
|
import sys
|
2019-02-26 12:23:33 -08:00
|
|
|
|
2020-01-05 21:35:52 -08:00
|
|
|
from setuptools import find_packages, setup
|
|
|
|
|
2018-12-30 00:23:26 -08:00
|
|
|
if sys.version_info < (3, 6):
|
|
|
|
print("Python 3.6 or newer is required", file=sys.stderr)
|
2015-12-21 09:38:38 -08:00
|
|
|
sys.exit(1)
|
|
|
|
|
2015-08-09 14:16:30 -07:00
|
|
|
if 'upload' in sys.argv[1:]:
|
|
|
|
print('Use twine to upload the package - setup.py upload is insecure')
|
|
|
|
sys.exit(1)
|
|
|
|
|
2018-10-10 23:53:08 -07:00
|
|
|
tests_require = open('requirements/test.txt', encoding='utf-8').read().splitlines()
|
2015-08-19 13:43:32 -07:00
|
|
|
|
2017-08-23 23:29:21 -07:00
|
|
|
|
|
|
|
def readme():
|
2018-10-10 23:53:08 -07:00
|
|
|
with open('README.md', encoding='utf-8') as f:
|
2017-08-23 23:29:21 -07:00
|
|
|
return f.read()
|
|
|
|
|
2019-02-26 12:23:33 -08:00
|
|
|
|
2015-07-25 23:45:13 -07:00
|
|
|
setup(
|
|
|
|
name='ocrmypdf',
|
|
|
|
description='OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched',
|
2017-08-23 23:29:21 -07:00
|
|
|
long_description=readme(),
|
2018-09-19 21:01:24 -07:00
|
|
|
long_description_content_type='text/markdown',
|
2015-09-05 00:53:14 -07:00
|
|
|
url='https://github.com/jbarlow83/OCRmyPDF',
|
|
|
|
author='James R. Barlow',
|
2020-05-19 16:12:36 -07:00
|
|
|
author_email='james@purplerock.ca',
|
2018-03-24 23:54:37 -07:00
|
|
|
packages=find_packages('src', exclude=["tests", "tests.*"]),
|
|
|
|
package_dir={'': 'src'},
|
2015-07-25 23:45:13 -07:00
|
|
|
keywords=['PDF', 'OCR', 'optical character recognition', 'PDF/A', 'scanning'],
|
2015-07-27 01:45:17 -07:00
|
|
|
classifiers=[
|
2017-01-02 18:17:38 -08:00
|
|
|
"Programming Language :: Python :: 3.6",
|
2018-06-28 13:57:45 -07:00
|
|
|
"Programming Language :: Python :: 3.7",
|
2019-10-20 03:20:54 -07:00
|
|
|
"Programming Language :: Python :: 3.8",
|
2020-06-26 00:06:58 -07:00
|
|
|
"Programming Language :: Python :: 3.9",
|
2015-09-05 00:53:14 -07:00
|
|
|
"Development Status :: 5 - Production/Stable",
|
2015-07-25 23:45:13 -07:00
|
|
|
"Environment :: Console",
|
|
|
|
"Intended Audience :: End Users/Desktop",
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
"Intended Audience :: System Administrators",
|
2018-03-14 14:40:48 -07:00
|
|
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
2015-07-25 23:45:13 -07:00
|
|
|
"Operating System :: MacOS :: MacOS X",
|
2019-12-09 21:39:01 -08:00
|
|
|
"Operating System :: Microsoft :: Windows :: Windows 10",
|
2015-07-25 23:45:13 -07:00
|
|
|
"Operating System :: POSIX",
|
|
|
|
"Operating System :: POSIX :: BSD",
|
|
|
|
"Operating System :: POSIX :: Linux",
|
|
|
|
"Topic :: Scientific/Engineering :: Image Recognition",
|
|
|
|
"Topic :: Text Processing :: Indexing",
|
|
|
|
"Topic :: Text Processing :: Linguistic",
|
2019-02-26 12:23:33 -08:00
|
|
|
],
|
2018-12-30 00:23:26 -08:00
|
|
|
python_requires=' >= 3.6',
|
2019-02-26 12:23:33 -08:00
|
|
|
setup_requires=[ # can be removed whenever we can drop pip 9 support
|
|
|
|
'cffi >= 1.9.1', # to build the leptonica module
|
|
|
|
'pytest-runner', # to enable python setup.py test
|
|
|
|
'setuptools_scm', # so that version will work
|
|
|
|
'setuptools_scm_git_archive', # enable version from github tarballs
|
2016-01-19 16:07:52 -08:00
|
|
|
],
|
|
|
|
use_scm_version={'version_scheme': 'post-release'},
|
2019-02-26 12:23:33 -08:00
|
|
|
cffi_modules=['src/ocrmypdf/lib/compile_leptonica.py:ffibuilder'],
|
2016-01-19 15:07:21 -08:00
|
|
|
install_requires=[
|
2019-02-26 12:23:33 -08:00
|
|
|
'cffi >= 1.9.1', # must be a setup and install requirement
|
2020-03-05 13:55:48 -08:00
|
|
|
'coloredlogs >= 14.0', # strictly optional
|
2019-02-26 12:23:33 -08:00
|
|
|
'img2pdf >= 0.3.0, < 0.4', # pure Python, so track HEAD closely
|
2020-08-03 16:04:16 -07:00
|
|
|
'pdfminer.six >= 20191110, <= 20200726',
|
2020-06-10 14:27:47 -07:00
|
|
|
'pikepdf >= 1.14.0, < 2',
|
|
|
|
'Pillow >= 7.0.0',
|
|
|
|
'pluggy >= 0.13.0',
|
2019-02-26 12:23:33 -08:00
|
|
|
'reportlab >= 3.3.0', # oldest released version with sane image handling
|
2019-05-16 13:49:07 -07:00
|
|
|
'tqdm >= 4',
|
2016-01-19 15:07:21 -08:00
|
|
|
],
|
2015-08-19 13:43:32 -07:00
|
|
|
tests_require=tests_require,
|
2019-03-26 08:10:20 +01:00
|
|
|
entry_points={'console_scripts': ['ocrmypdf = ocrmypdf.__main__:run']},
|
2016-05-10 21:58:04 -07:00
|
|
|
package_data={'ocrmypdf': ['data/sRGB.icc']},
|
2015-07-25 23:45:13 -07:00
|
|
|
include_package_data=True,
|
2018-09-19 21:01:24 -07:00
|
|
|
zip_safe=False,
|
|
|
|
project_urls={
|
|
|
|
'Documentation': 'https://ocrmypdf.readthedocs.io/',
|
|
|
|
'Source': 'https://github.com/jbarlow83/ocrmypdf',
|
2019-02-26 12:23:33 -08:00
|
|
|
'Tracker': 'https://github.com/jbarlow83/ocrmypdf/issues',
|
|
|
|
},
|
2018-09-19 21:01:24 -07:00
|
|
|
)
|