setup.py 1.83 KB
Newer Older
1
#!/usr/bin/env python
2

Jerome Flesch's avatar
Jerome Flesch committed
3
import sys
4
from setuptools import setup
5

Jerome Flesch's avatar
Jerome Flesch committed
6 7 8 9 10 11 12 13 14 15 16 17
try:
    with open("src/pyocr/_version.py", "r") as file_descriptor:
        version = file_descriptor.read().strip()
        version = version.split(" ")[2][1:-1]
    print("PyOCR version: {}".format(version))
    if "-" in version:
        version = version.split("-")[0]
except FileNotFoundError:
    print("ERROR: _version.py file is missing")
    print("ERROR: Please run 'make version' first")
    sys.exit(1)

Jerome Flesch's avatar
Jerome Flesch committed
18 19
setup(
    name="pyocr",
Jerome Flesch's avatar
Jerome Flesch committed
20
    version=version,
Jerome Flesch's avatar
Jerome Flesch committed
21 22 23
    description=("A Python wrapper for OCR engines (Tesseract, Cuneiform,"
                 " etc)"),
    keywords="tesseract cuneiform ocr",
24
    url="https://github.com/openpaperwork/pyocr",
Jerome Flesch's avatar
Jerome Flesch committed
25 26 27 28
    download_url=(
        "https://github.com/openpaperwork/pyocr/archive/"
        "{}.zip".format(version)
    ),
Jerome Flesch's avatar
Jerome Flesch committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: GNU General Public License v3 or later"
        " (GPLv3+)",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.3",
        "Topic :: Multimedia :: Graphics :: Capture :: Scanners",
        "Topic :: Multimedia :: Graphics :: Graphics Conversion",
        "Topic :: Scientific/Engineering :: Image Recognition",
    ],
    license="GPLv3+",
    author="Jerome Flesch",
45
    author_email="jflesch@openpaper.work",
46 47
    packages=[
        'pyocr',
48
        'pyocr.libtesseract',
49 50 51
    ],
    package_dir={
        'pyocr': 'src/pyocr',
52
        'pyocr.libtesseract': 'src/pyocr/libtesseract',
53
    },
Jerome Flesch's avatar
Jerome Flesch committed
54 55
    data_files=[],
    scripts=[],
56
    zip_safe=True,
Jerome Flesch's avatar
Jerome Flesch committed
57 58
    install_requires=[
        "Pillow",
Jerome Flesch's avatar
Jerome Flesch committed
59
        "six",
Jerome Flesch's avatar
Jerome Flesch committed
60 61
    ],
)