Skip to content

Commit

Permalink
Merge pull request #296 from jpweytjens/min_python_version
Browse files Browse the repository at this point in the history
Sphinx only supports python 3.5+
  • Loading branch information
jpweytjens committed Jul 31, 2019
2 parents cee7546 + ee8553b commit e500168
Show file tree
Hide file tree
Showing 24 changed files with 141 additions and 95 deletions.
21 changes: 15 additions & 6 deletions .travis.yml
@@ -1,10 +1,10 @@
sudo: required
dist: trusty
dist: bionic

language: python
python:
- "2.7"
- "3.4"
- "3.7"

# install system dependencies here with apt-get.
before_install:
Expand All @@ -13,15 +13,24 @@ before_install:
# install python dependencies including this package in the travis
# virtualenv
install:
- ./provision/python.sh
- pip install .

- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]];
then ./provision/python3.sh;
fi
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]];
then ./provision/python2.sh;
fi
- pip install .[pocketsphinx]

# commands to run the testing suite. if any of these fail, travic lets us know
script:
- cd tests && make && cd -
- nosetests --with-coverage --cover-package=textract
- pep8 textract/ bin/textract
- cd docs && make html && cd -
- cd tests && pytest && cd -
- pycodestyle textract/ bin/textract
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]];
then cd docs && make html && cd -;
fi

# commands to run after the tests successfully complete
after_success:
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -24,8 +24,8 @@ Extract text from any document. No muss. No fuss.
.. |Downloads| image:: https://img.shields.io/pypi/dm/textract.svg
:target: https://warehouse.python.org/project/textract/

.. |Test Coverage| image:: https://coveralls.io/repos/deanmalmgren/textract/badge.png
:target: https://coveralls.io/r/deanmalmgren/textract
.. |Test Coverage| image:: https://coveralls.io/repos/github/deanmalmgren/textract/badge.svg?branch=master
:target: https://coveralls.io/github/deanmalmgren/textract?branch=master

.. |Documentation Status| image:: https://readthedocs.org/projects/textract/badge/?version=latest
:target: https://readthedocs.org/projects/textract/?badge=latest
Expand Down
1 change: 1 addition & 0 deletions bin/textract 100755 → 100644
Expand Up @@ -29,4 +29,5 @@ def main():
else:
args.output.write(output)


main()
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -58,7 +58,7 @@
# built documents.
#
# The short X.Y version.
release = version = "1.6.1"
release = version = "1.6.3"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -132,7 +132,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['.static']
html_static_path = []

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Expand Up @@ -74,7 +74,7 @@ file types by either mentioning them on the `issue tracker

* ``.pptx`` via `python-pptx`_

* ``.ps`` via `ps2text`_
* ``.ps`` via `ps2ascii`_

* ``.rtf`` via `unrtf`_

Expand All @@ -96,7 +96,7 @@ file types by either mentioning them on the `issue tracker
.. _pdfminer.six: https://github.com/goulu/pdfminer
.. _pdftotext: http://poppler.freedesktop.org/
.. _pocketsphinx: https://github.com/cmusphinx/pocketsphinx/
.. _ps2text: http://pages.cs.wisc.edu/~ghost/doc/pstotext.htm
.. _ps2ascii: https://www.ghostscript.com/doc/current/Use.htm
.. _python-docx2txt: https://github.com/ankushshah89/python-docx2txt
.. _python-pptx: https://python-pptx.readthedocs.org/en/latest/
.. _SpeechRecognition: https://pypi.python.org/pypi/SpeechRecognition/
Expand Down
2 changes: 1 addition & 1 deletion provision/python.sh → provision/python2.sh
Expand Up @@ -12,4 +12,4 @@ fi
pip install -U pip

# Install the requirements for this package as well as this module.
pip install -r requirements/python-dev
pip install -r requirements/python-dev2
16 changes: 16 additions & 0 deletions provision/python3.sh
@@ -0,0 +1,16 @@
#!/bin/bash

# This needs to work for vagrant, Travis builds, and Docker builds.
# in a python virtualenv. in the virtual machine provisioning,
# we're passing the directory this should be run from. in travis-ci,
# its run from the root of the repository.
if [ "$#" -eq 1 ]; then
cd $1
fi

# upgrade pip so we can use wheel downloads
pip install -U pip

# Install the requirements for this package as well as this module.
pip install -r requirements/python-dev3
pip install -r requirements/python-doc
4 changes: 3 additions & 1 deletion requirements/debian
@@ -1,6 +1,7 @@
# required packages
gcc
libpulse-dev
libasound2-dev
libjpeg-dev
build-essential
git
Expand All @@ -9,6 +10,7 @@ make
# these packages are required by python-docx, which depends on lxml
# and requires these things
python-dev
python-pip
libxml2-dev
libxslt1-dev

Expand All @@ -19,7 +21,7 @@ antiword
unrtf

# parse image files
tesseract-ocr=3.03\*
tesseract-ocr
libjpeg-dev

# parse pdfs
Expand Down
2 changes: 1 addition & 1 deletion requirements/python
Expand Up @@ -2,7 +2,7 @@
# package in order for it to properly work.

argcomplete==1.10.0
beautifulsoup4==4.7.1
beautifulsoup4==4.8.0
chardet==3.0.4
docx2txt==0.8
EbookLib==0.17.1
Expand Down
6 changes: 3 additions & 3 deletions requirements/python-dev → requirements/python-dev2
Expand Up @@ -3,14 +3,14 @@
# documentation builds (python-doc)

-r python
-r python-doc

# needed for tests/run.py script to read .travis.yml file
coveralls==1.8.1
coveralls==1.8.2
nose==1.3.7
pep8==1.7.1
pycodestyle==2.5.0
PyYAML==5.1.1
requests==2.22.0
pytest==4.6

# needed for managing versions
bumpversion==0.5.3
16 changes: 16 additions & 0 deletions requirements/python-dev3
@@ -0,0 +1,16 @@
# This includes all packages that are used in development, including all
# packages that are required by textract itself (python), packages for
# documentation builds (python-doc)

-r python

# needed for tests/run.py script to read .travis.yml file
coveralls==1.8.2
nose==1.3.7
pycodestyle==2.5.0
PyYAML==5.1.1
pytest==5.0.1
requests==2.22.0

# needed for managing versions
bumpversion==0.5.3
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.6.2
current_version = 1.6.3
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -42,7 +42,7 @@ def parse_requirements(requirements_filename):

setup(
name=textract.__name__,
version="1.6.2",
version="1.6.3",
description="extract text from any document. no muss. no fuss.",
long_description=long_description,
url=github_url,
Expand Down
6 changes: 5 additions & 1 deletion tests/Makefile
Expand Up @@ -11,7 +11,8 @@ TARGETS = pdf/ocr_text.txt \
png/raw_text.txt png/standardized_text.txt \
gif/raw_text.txt gif/standardized_text.txt \
jpg/raw_text.txt jpg/standardized_text.txt \
tiff/raw_text.txt tiff/standardized_text.txt
tiff/raw_text.txt tiff/standardized_text.txt \
ps/raw_text.txt

all: $(TARGETS)

Expand All @@ -27,6 +28,9 @@ pdf/ocr_text.txt: pdf/ocr_text.pdf
cat pdf-ocr-text*.txt > $@
rm -f pdf-ocr-text*

ps/raw_text.txt: ps/raw_text.ps
ps2ascii $< > $@

# simple pattern rule for creating standard issue tesseract files for different
# fileypes. the `g` shell variable is the path to the file without the
# extension (e.g. g=png/raw_text)
Expand Down

0 comments on commit e500168

Please sign in to comment.