diff --git a/.gitignore b/.gitignore index 4a84f20..d71bc86 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tessdata/ coverage_html_report/ .coverage coverage.xml +.vscode \ No newline at end of file diff --git a/setup.py b/setup.py index fde472f..fd9d91f 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ install_requires = [ - "wagtail>=2,<2.6", + "wagtail>=2,<2.13", "textract", ] @@ -55,6 +55,8 @@ 'Framework :: Django :: 2.0', 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', 'Framework :: Wagtail', 'Framework :: Wagtail :: 2', 'Topic :: Internet :: WWW/HTTP :: Site Management', diff --git a/src/wagtail_textract/management/commands/transcribe_documents.py b/src/wagtail_textract/management/commands/transcribe_documents.py index 7e836ec..cee4785 100644 --- a/src/wagtail_textract/management/commands/transcribe_documents.py +++ b/src/wagtail_textract/management/commands/transcribe_documents.py @@ -1,6 +1,9 @@ from django.core.management.base import BaseCommand -from wagtail.documents.models import get_document_model +try: + from wagtail.documents.models import get_document_model +except ImportError: + from wagtail.documents import get_document_model from wagtail_textract.handlers import async_transcribe_document diff --git a/src/wagtail_textract/settings.py b/src/wagtail_textract/settings.py index 4cef3a8..711543c 100644 --- a/src/wagtail_textract/settings.py +++ b/src/wagtail_textract/settings.py @@ -1,4 +1,4 @@ from wagtail.tests.settings import * WAGTAILDOCS_DOCUMENT_MODEL = 'wagtail_textract.document' -INSTALLED_APPS = INSTALLED_APPS + ('wagtail_textract',) +INSTALLED_APPS += ('wagtail_textract',) diff --git a/src/wagtail_textract/tests/settings.py b/src/wagtail_textract/tests/settings.py index ede12a5..7e3b1a4 100644 --- a/src/wagtail_textract/tests/settings.py +++ b/src/wagtail_textract/tests/settings.py @@ -2,4 +2,7 @@ MEDIA_ROOT = '.' WAGTAILDOCS_DOCUMENT_MODEL = 'wagtail_textract.document' -INSTALLED_APPS = INSTALLED_APPS + ('wagtail_textract',) +if type(INSTALLED_APPS) is list: + INSTALLED_APPS = INSTALLED_APPS + ['wagtail_textract',] +else: + INSTALLED_APPS = INSTALLED_APPS + ('wagtail_textract',) diff --git a/src/wagtail_textract/tests/test_document_class.py b/src/wagtail_textract/tests/test_document_class.py index 30df6cf..2f68d70 100644 --- a/src/wagtail_textract/tests/test_document_class.py +++ b/src/wagtail_textract/tests/test_document_class.py @@ -1,4 +1,7 @@ -from wagtail.documents.models import get_document_model +try: + from wagtail.documents.models import get_document_model # wagtail < 2.8 +except ImportError: + from wagtail.documents import get_document_model # wagtail >= 2.8 def test_document_class(): diff --git a/src/wagtail_textract/tests/test_management_command.py b/src/wagtail_textract/tests/test_management_command.py index 2b7cfda..19cbf6f 100644 --- a/src/wagtail_textract/tests/test_management_command.py +++ b/src/wagtail_textract/tests/test_management_command.py @@ -3,7 +3,10 @@ from django.core.files import File from django.core.management import call_command -from wagtail.documents.models import get_document_model +try: + from wagtail.documents.models import get_document_model # wagtail < 2.8 +except ImportError: + from wagtail.documents import get_document_model # wagtail >= 2.8 Document = get_document_model() diff --git a/tox.ini b/tox.ini index 25c0cf4..1c9b444 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,12 @@ envlist = py{35,36}-dj{21}-wt{23} py{35,36,37}-dj{21}-wt{24} py{35,36,37}-dj{22}-wt{25} + py{35,36,37}-dj{22}-wt{26} + py{35,36,37}-dj{22}-wt{27} + py{35,36,37}-dj{22}-wt{28} + py{35,36,37}-dj{22}-wt{29} + py{36,37}-dj{22}-wt{210} + py{36,37}-dj{22}-wt{211} [testenv] basepython = @@ -26,6 +32,12 @@ deps = wt23: wagtail>=2.3,<2.4 wt24: wagtail>=2.4,<2.5 wt25: wagtail>=2.5,<2.6 + wt26: wagtail>=2.6,<2.7 + wt27: wagtail>=2.7,<2.8 + wt28: wagtail>=2.8,<2.9 + wt29: wagtail>=2.9,<2.10 + wt210: wagtail>=2.10,<2.11 + wt211: wagtail>=2.11,<2.12 whitelist_externals = make diff --git a/travis-textract-requirements/python-dev.txt b/travis-textract-requirements/python-dev.txt index bd820cd..b5b09b4 100644 --- a/travis-textract-requirements/python-dev.txt +++ b/travis-textract-requirements/python-dev.txt @@ -13,4 +13,4 @@ requests==2.18.1 nose==1.3.7 # needed for managing versions -bumpversion==0.5.3 +bumpversion==0.5.3 \ No newline at end of file diff --git a/travis-textract-requirements/python.txt b/travis-textract-requirements/python.txt index 98fb9b0..827a34d 100644 --- a/travis-textract-requirements/python.txt +++ b/travis-textract-requirements/python.txt @@ -1,16 +1,18 @@ # This file contains all python dependencies that are required by the textract # package in order for it to properly work. -argcomplete==1.8.2 +argcomplete==1.10.0 chardet==3.0.4 -python-pptx==0.6.12 +python-pptx==0.6.18 +pdfminer.six==20181108 #pdfminer.six <-- go back to this after the shebang fix is released (see https://github.com/goulu/pdfminer/issues/27) -https://github.com/goulu/pdfminer/zipball/e6ad15af79a26c31f4e384d8427b375c93b03533#egg=pdfminer.six -docx2txt==0.6 -beautifulsoup4==4.6.0 -xlrd==1.0.0 -EbookLib==0.16 -SpeechRecognition==3.7.1 +#https://github.com/goulu/pdfminer/zipball/e6ad15af79a26c31f4e384d8427b375c93b03533#egg=pdfminer.six +docx2txt==0.8 +beautifulsoup4==4.8.2 +xlrd==1.2.0 +EbookLib==0.17.1 +SpeechRecognition==3.8.1 https://github.com/mattgwwalker/msg-extractor/zipball/master -six==1.10.0 -pocketsphinx==0.1.3 +six==1.12.0 +extract-msg==0.23.1 +tzlocal==1.5.1 \ No newline at end of file