Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 2.x compatibility #50

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ env:
- TOX_ENV=py35-django18
- TOX_ENV=py35-django111
- TOX_ENV=py35-django20
- TOX_ENV=py35-djangomaster
- TOX_ENV=py35-django21
- TOX_ENV=py35-django22
matrix:
include:
- env: TOX_ENV=py36-django18
Expand All @@ -21,6 +22,10 @@ matrix:
python: "3.6"
- env: TOX_ENV=py36-django20
python: "3.6"
- env: TOX_ENV=py36-django21
python: "3.6"
- env: TOX_ENV=py36-django22
python: "3.6"
- env: TOX_ENV=py36-djangomaster
python: "3.6"
install: pip install tox
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ Changelog
0.6.3 (unreleased)
------------------

- Nothing changed yet.

- Confirm compatibility with Django 2.2
- Compatibility with Django 2.1 added.
From @tsouvarev work : https://github.com/python-babel/django-babel/pull/45

0.6.2 (2017-12-18)
------------------
Expand Down
11 changes: 10 additions & 1 deletion django_babel/extract.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# -*- coding: utf-8 -*-
from django.template.base import Lexer, TOKEN_TEXT, TOKEN_VAR, TOKEN_BLOCK
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, TOKEN_VAR, TOKEN_BLOCK
else:
TOKEN_TEXT = TokenType.TEXT
TOKEN_VAR = TokenType.VAR
TOKEN_BLOCK = TokenType.BLOCK

from django.utils.translation import trim_whitespace
from django.utils.encoding import smart_text

Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[tox]
envlist = py{35,36}-djangomaster, py{27,34,35,36}-django{18,111,20}, lint, docs
envlist = py{27,35,36}-django{18,111},
py{35,36,37}-django{20,21,22},
py{36,37}-django{master},
lint, docs

[testenv]
deps =
Expand All @@ -11,6 +14,8 @@ deps =
django18: Django>=1.8,<1.9
django111: Django>=1.11,<2.0
django20: Django>=2.0,<2.1
django21: Django>=2.1,<2.2
django22: Django>=2.2,<3
djangomaster: https://github.com/django/django/archive/master.tar.gz#egg=Django
commands = py.test {posargs}

Expand Down