diff --git a/.travis.yml b/.travis.yml index 487f6fb..91c37e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ env: - DJANGO_VERSION=1.9.x - DJANGO_VERSION=1.10.x - DJANGO_VERSION=1.11.x + - DJANGO_VERSION=2.2.x install: - pip install tox script: @@ -19,5 +20,15 @@ matrix: exclude: - python: "2.7" env: DJANGO_VERSION=master + - python: "2.7" + env: DJANGO_VERSION=2.2.x + - python: "3.4" + env: DJANGO_VERSION=master + - python: "3.4" + env: DJANGO_VERSION=2.2.x + - python: "3.5" + env: DJANGO_VERSION=master + - python: "pypy" + env: DJANGO_VERSION=2.2.x - python: "pypy" env: DJANGO_VERSION=master diff --git a/setup.py b/setup.py index 5805f02..8c4de98 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ def read(*parts): install_requires = [ - 'django>=1.8,<2.0', + 'django>=1.8,<=2.2', 'babel>=1.3', 'django-babel>=0.5.1', 'markey>=0.8,<0.9', @@ -83,5 +83,8 @@ def read(*parts): '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', ], ) diff --git a/src/django_babel_underscore/__init__.py b/src/django_babel_underscore/__init__.py index 6cd5bd7..e4ae7b4 100755 --- a/src/django_babel_underscore/__init__.py +++ b/src/django_babel_underscore/__init__.py @@ -1,10 +1,13 @@ # -*- coding: utf-8 -*- import django -if django.VERSION[:2] >= (1, 8): - from django.template.base import Lexer, TOKEN_TEXT +from django.template.base import Lexer +try: + from django.template.base import TokenType +except ImportError: # django < 2.1 + from django.template.base import TOKEN_TEXT else: - from django.template import Lexer, TOKEN_TEXT + TOKEN_TEXT = TokenType.TEXT from django.utils.encoding import force_text from django_babel.extract import extract_django diff --git a/tox.ini b/tox.ini index eb837e8..4bae3f9 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,8 @@ deps110 = https://github.com/django/django/archive/stable/1.10.x.tar.gz#egg=django deps111 = https://github.com/django/django/archive/stable/1.11.x.tar.gz#egg=django +deps22 = + https://github.com/django/django/archive/stable/2.2.x.tar.gz#egg=django master = https://github.com/django/django/archive/master.tar.gz#egg=django @@ -69,6 +71,10 @@ deps = {[testenv]deps110} basepython = python3.5 deps = {[testenv]deps111} +[testenv:3.5-2.2.x] +basepython = python3.5 +deps = {[testenv]deps22} + [testenv:3.5-master] basepython = python3.5 deps = {[testenv]master}