Update setup and readme to specify Python 3+.

parent 3c40533a
......@@ -33,7 +33,6 @@ systems (*BSD, etc). It may or may not work on Windows, MacOSX, etc.
## Installation
```sh
sudo pip install pyocr # Python 2.7
sudo pip3 install pyocr # Python 3.X
```
......@@ -262,7 +261,7 @@ Beware this code hasn't been adapted to libtesseract 3 yet.
## Dependencies
* PyOCR requires python 2.7 or later. Python 3 is supported.
* PyOCR requires Python 3.4 or later.
* You will need [Pillow](https://github.com/python-imaging/Pillow)
or Python Imaging Library (PIL). Under Debian/Ubuntu, Pillow is in
the package ```python-pil``` (```python3-pil``` for the Python 3
......
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
from setuptools import setup
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
if sys.version_info < (3, 4):
error = """
Beginning with PyOCR 0.7, Python 3.4 or above is required.
This may be due to an out of date pip.
Make sure you have pip >= 9.0.1.
"""
sys.exit(error)
setup(
name="pyocr",
description=("A Python wrapper for OCR engines (Tesseract, Cuneiform,"
......@@ -16,9 +30,11 @@ setup(
" (GPLv3+)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Multimedia :: Graphics :: Capture :: Scanners",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Scientific/Engineering :: Image Recognition",
......@@ -36,6 +52,7 @@ setup(
data_files=[],
scripts=[],
zip_safe=True,
python_requires='>=3.4',
install_requires=[
"Pillow",
],
......
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for existing editable installs.
import sys
if sys.version_info < (3, 4): # noqa: E402
raise ImportError("""
PyOCR 0.7+ does not support Python 2.x, 3.0, 3.1, 3.2, or 3.3.
Beginning with PyOCR 0.7, Python 3.4 and above is required.
See PyOCR `README.markdown` file for more information:
https://gitlab.gnome.org/World/OpenPaperwork/pyocr/blob/master/README.markdown
""")
from .pyocr import * # noqa
from .error import PyocrException
......
......@@ -4,6 +4,7 @@ envlist=py3
[testenv]
deps=
pytest
setuptools >= 9.0.1
commands=pytest {posargs}
[flake8]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment