Skip to content

Commit 3f6cf53

Browse files
noamkushsafwanrahman
authored andcommitted
Added support for Django 3.0. (django-es#230)
1 parent dc3d89f commit 3f6cf53

File tree

13 files changed

+18
-24
lines changed

13 files changed

+18
-24
lines changed

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ dist: xenial # default "precise" distro doesn't include Java 8 for Elasticsearch
77

88
matrix:
99
include:
10-
- env: TOX_ENV=py36-django-110-es6
11-
python: 3.6
12-
- env: TOX_ENV=py37-django-110-es6
13-
python: 3.7
14-
- env: TOX_ENV=py27-django-110-es6
15-
python: 2.7
1610
- env: TOX_ENV=py36-django-111-es6
1711
python: 3.6
1812
- env: TOX_ENV=py37-django-111-es6
@@ -27,6 +21,8 @@ matrix:
2721
python: 3.7
2822
- env: TOX_ENV=py37-django-22-es6
2923
python: 3.7
24+
- env: TOX_ENV=py37-django-30-es6
25+
python: 3.7
3026

3127
cache: pip
3228
env:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Features
2929
- Complex field type support (ObjectField, NestedField).
3030
- Requirements
3131

32-
- Django >= 1.10
32+
- Django >= 1.11
3333
- Python 2.7, 3.5, 3.6, 3.7
3434

3535
**Elasticsearch Compatibility:**

django_elasticsearch_dsl/documents.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
from __future__ import unicode_literals
22

33
from collections import deque
4-
from copy import deepcopy
54
from functools import partial
65

76
from django import VERSION as DJANGO_VERSION
87
from django.db import models
9-
from django.utils.six import iteritems
108
from elasticsearch.helpers import bulk, parallel_bulk
119
from elasticsearch_dsl import Document as DSLDocument
10+
from six import iteritems
1211

1312
from .exceptions import ModelFieldNotMappedError
1413
from .fields import (

django_elasticsearch_dsl/indices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from copy import deepcopy
22

3-
from django.utils.encoding import python_2_unicode_compatible
43
from elasticsearch_dsl import Index as DSLIndex
4+
from six import python_2_unicode_compatible
55

66
from .apps import DEDConfig
77
from .registries import registry

django_elasticsearch_dsl/management/commands/search_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from django.conf import settings
44
from django.core.management.base import BaseCommand, CommandError
5-
from django.utils.six.moves import input
5+
from six.moves import input
66
from ...registries import registry
77

88

django_elasticsearch_dsl/registries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
from django.core.exceptions import ObjectDoesNotExist
77
from django.core.exceptions import ImproperlyConfigured
8-
from django.utils.six import itervalues, iterkeys, iteritems
98
from elasticsearch_dsl import Field, AttrDict
9+
from six import itervalues, iterkeys, iteritems
1010

1111
from django_elasticsearch_dsl.exceptions import RedeclaredFieldError
1212
from .apps import DEDConfig

example/test_app/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
3-
from django.utils.encoding import python_2_unicode_compatible
43
from django.db import models
4+
from six import python_2_unicode_compatible
55

66

77
@python_2_unicode_compatible

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,19 @@
4343
include_package_data=True,
4444
install_requires=[
4545
'elasticsearch-dsl>=7.0.0<8.0.0',
46+
'six',
4647
],
4748
license="Apache Software License 2.0",
4849
zip_safe=False,
4950
keywords='django elasticsearch elasticsearch-dsl',
5051
classifiers=[
5152
'Development Status :: 3 - Alpha',
5253
'Framework :: Django',
53-
'Framework :: Django :: 1.10',
5454
'Framework :: Django :: 1.11',
5555
'Framework :: Django :: 2.0',
5656
'Framework :: Django :: 2.1',
57+
'Framework :: Django :: 2.2',
58+
'Framework :: Django :: 3.0',
5759
'Intended Audience :: Developers',
5860
'License :: OSI Approved :: BSD License',
5961
'Natural Language :: English',

tests/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33
from django.db import models
4-
from django.utils.encoding import python_2_unicode_compatible
54
from django.utils.translation import ugettext_lazy as _
5+
from six import python_2_unicode_compatible
66

77

88
@python_2_unicode_compatible

tests/test_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from django.core.management.base import CommandError
55
from django.core.management import call_command
6-
from django.utils.six import StringIO
6+
from six import StringIO
77

88
from django_elasticsearch_dsl import Index
99
from django_elasticsearch_dsl.management.commands.search_index import Command

tests/test_fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from unittest import TestCase
22

33
from django.db.models.fields.files import FieldFile
4-
from django.utils.six import string_types
54
from django.utils.translation import ugettext_lazy as _
65
from mock import Mock, NonCallableMock
6+
from six import string_types
77

88
from django_elasticsearch_dsl.exceptions import VariableLookupError
99
from django_elasticsearch_dsl.fields import (

tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
from django.core.management import call_command
66
from django.test import TestCase
7-
from django.utils.six import StringIO
87
from django.utils.translation import ugettext_lazy as _
8+
from six import StringIO
99

1010
from elasticsearch_dsl import Index as DSLIndex
1111
from django_elasticsearch_dsl.test import ESTestCase

tox.ini

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
[tox]
22
envlist =
3-
{py27,py36,py37}-django-110-{es7}
4-
{py27,py36,py37}-django-111-{es7}
5-
{py36,py37}-django-2-{es7}
6-
{py36,py37}-django-21-{es7}
7-
{py36,py37}-django-22-{es7}
3+
py27-django-111-es7
4+
{py36,py37}-django-{111,2,21,22,30}-{es7}
85

96
[testenv]
107
setenv =
@@ -13,11 +10,11 @@ commands = python runtests.py {posargs}
1310

1411

1512
deps =
16-
django-110: Django>=1.10,<1.11
1713
django-111: Django>=1.11,<2.0
1814
django-2: Django>=2.0,<2.1
1915
django-21: Django>=2.1,<2.2
2016
django-22: Django>=2.2,<2.3
17+
django-30: Django>=3.0,<3.1
2118
es6: elasticsearch-dsl>=6.4.0,<7.0.0
2219
es7: elasticsearch-dsl>=7,<8
2320
-r{toxinidir}/requirements_test.txt

0 commit comments

Comments
 (0)