Skip to content

Commit 7c8e778

Browse files
feat: add support for support for Python/Django (#460)
Co-authored-by: Safwan Rahman <[email protected]>
1 parent 18752d6 commit 7c8e778

File tree

8 files changed

+22
-115
lines changed

8 files changed

+22
-115
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -7,104 +7,36 @@ on:
77

88
jobs:
99
test:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-latest
1111

1212
strategy:
1313
fail-fast: false
1414

1515
matrix:
16-
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
17-
django-version: ["1.11", "2.0", "2.2", "2.1", "3.0", "3.1","3.2", "4.0", "4.1",]
16+
python-version: ["3.8", "3.9", "3.10", "3.11"]
17+
django-version: ["3.2", "4.1", "4.2"]
1818
es-dsl-version: ["6.4", "7.4"]
1919
es-version: ["7.13.4"]
2020

2121
exclude:
22-
- python-version: "2.7"
23-
django-version: "2.0"
24-
- python-version: "2.7"
25-
django-version: "2.1"
26-
- python-version: "2.7"
27-
django-version: "2.2"
28-
- python-version: "2.7"
29-
django-version: "3.0"
30-
- python-version: "2.7"
31-
django-version: "3.1"
32-
- python-version: "2.7"
33-
django-version: "3.2"
34-
- python-version: "2.7"
35-
django-version: "4.0"
36-
- python-version: "2.7"
37-
django-version: "4.1"
38-
39-
- python-version: "3.6"
40-
django-version: "4.0"
41-
- python-version: "3.6"
42-
django-version: "4.1"
43-
44-
- python-version: "3.7"
45-
django-version: "4.0"
46-
- python-version: "3.7"
47-
django-version: "4.1"
48-
49-
- python-version: "3.8"
50-
django-version: "1.11"
51-
- python-version: "3.8"
52-
django-version: "2.0"
53-
- python-version: "3.8"
54-
django-version: "2.1"
55-
56-
- python-version: "3.9"
57-
django-version: "1.11"
58-
- python-version: "3.9"
59-
django-version: "2.0"
60-
- python-version: "3.9"
61-
django-version: "2.1"
62-
63-
- python-version: "3.10"
64-
django-version: "1.11"
65-
- python-version: "3.10"
66-
django-version: "2.0"
67-
- python-version: "3.10"
68-
django-version: "2.1"
69-
- python-version: "3.10"
70-
django-version: "2.2"
71-
- python-version: "3.10"
72-
django-version: "3.0"
73-
- python-version: "3.10"
74-
django-version: "3.1"
75-
76-
- python-version: "3.11"
77-
django-version: "1.11"
78-
- python-version: "3.11"
79-
django-version: "2.0"
80-
- python-version: "3.11"
81-
django-version: "2.1"
82-
- python-version: "3.11"
83-
django-version: "2.2"
84-
- python-version: "3.11"
85-
django-version: "3.0"
86-
- python-version: "3.11"
87-
django-version: "3.1"
8822
- python-version: "3.11"
8923
django-version: "3.2"
90-
- python-version: "3.11"
91-
django-version: "4.0"
9224

9325
steps:
9426
- name: Install and Run Elasticsearch
9527
uses: elastic/elastic-github-actions/elasticsearch@master
9628
with:
9729
stack-version: ${{ matrix.es-version }}
9830

99-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
10032

10133
- name: Install Python ${{ matrix.python-version }}
102-
uses: actions/setup-python@v2
34+
uses: actions/setup-python@v4
10335
with:
10436
python-version: ${{ matrix.python-version }}
10537

10638
- name: Cache Pip Dependencies
107-
uses: actions/cache@v2
39+
uses: actions/cache@v3
10840
with:
10941
path: ~/.cache/pip
11042
key: ${{ runner.os }}-pip-${{ hashFiles('requirements_test.txt') }}
@@ -125,4 +57,4 @@ jobs:
12557
python -m tox -e $TOX_ENV -- --elasticsearch --signal-processor celery
12658
12759
- name: Publish Coverage Report
128-
uses: codecov/codecov-action@v1
60+
uses: codecov/codecov-action@v3

README.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Features
3030
- Index fast using `parallel` indexing.
3131
- Requirements
3232

33-
- Django >= 1.11
34-
- Python 2.7, 3.5, 3.6, 3.7, 3.8
33+
- Django >= 3.2
34+
- Python 3.8, 3.9, 3.10, 3.11
3535

3636
**Elasticsearch Compatibility:**
3737
The library is compatible with all Elasticsearch versions since 5.x
@@ -41,8 +41,6 @@ The library is compatible with all Elasticsearch versions since 5.x
4141

4242
- For Elasticsearch 6.0 and later, use the major version 6 (6.x.y) of the library.
4343

44-
- For Elasticsearch 5.0 and later, use the major version 0.5 (0.5.x) of the library.
45-
4644
.. code-block:: python
4745
4846
# Elasticsearch 7.x
@@ -51,7 +49,4 @@ The library is compatible with all Elasticsearch versions since 5.x
5149
# Elasticsearch 6.x
5250
elasticsearch-dsl>=6.0.0,<7.0.0
5351
54-
# Elasticsearch 5.x
55-
elasticsearch-dsl>=0.5.1,<6.0.0
56-
5752
.. _Search: http://elasticsearch-dsl.readthedocs.io/en/stable/search_dsl.html

django_elasticsearch_dsl/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ def autodiscover():
1313
autodiscover_modules('documents')
1414

1515

16-
if django.VERSION < (3, 2):
17-
default_app_config = 'django_elasticsearch_dsl.apps.DEDConfig'

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
django>=1.9.6
1+
django>=3.2
22
elasticsearch-dsl>=7.0.0,<8.0.0

requirements_dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
bumpversion==0.5.3
2-
wheel==0.32.2
3-
django>=2.0,<2.2
1+
bumpversion==0.6.0
2+
wheel==0.41.2
3+
django>=3.2
44
elasticsearch-dsl>=7.0.0,<8.0.0
55
twine
66
sphinx

requirements_test.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
coverage==4.1
1+
coverage==7.3.1
22
mock>=1.0.1
33
flake8>=2.1.0
44
tox>=1.7.0
5-
Pillow==6.2.0
5+
Pillow==10.0.0
66
celery>=4.1.0
77

8-
98
# Additional test requirements go here

setup.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,17 @@
5151
classifiers=[
5252
'Development Status :: 3 - Alpha',
5353
'Framework :: Django',
54-
'Framework :: Django :: 1.11',
55-
'Framework :: Django :: 2.0',
56-
'Framework :: Django :: 2.1',
57-
'Framework :: Django :: 2.2',
58-
'Framework :: Django :: 3.0',
59-
'Framework :: Django :: 3.1',
6054
'Framework :: Django :: 3.2',
61-
'Framework :: Django :: 4.0',
55+
'Framework :: Django :: 4.1',
56+
'Framework :: Django :: 4.2',
6257
'Intended Audience :: Developers',
6358
'License :: OSI Approved :: BSD License',
6459
'Natural Language :: English',
65-
'Programming Language :: Python :: 2',
66-
'Programming Language :: Python :: 2.7',
6760
'Programming Language :: Python :: 3',
68-
'Programming Language :: Python :: 3.5',
69-
'Programming Language :: Python :: 3.6',
70-
'Programming Language :: Python :: 3.7',
7161
'Programming Language :: Python :: 3.8',
7262
'Programming Language :: Python :: 3.9',
7363
'Programming Language :: Python :: 3.10',
64+
'Programming Language :: Python :: 3.11',
7465
],
7566
extras_require={
7667
'celery': ["celery>=4.1.0"],

tox.ini

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
[tox]
22
envlist =
3-
py27-django-111-es74
4-
{py36,py37,py38,py39,py310,py311}-django-{111,20,21,22,30,31,32,40,41}-{es64,es74}
3+
py{38,39,310}-django-{32,41,42}-{es64,es74}
4+
py{311}-django-{41,42}-{es64,es74}
5+
56

67
[testenv]
78
setenv =
89
PYTHONPATH = {toxinidir}:{toxinidir}/django_elasticsearch_dsl
910
commands = coverage run --source django_elasticsearch_dsl runtests.py {posargs}
1011

1112
deps =
12-
django-111: Django>=1.11,<2.0
13-
django-20: Django>=2.0,<2.1
14-
django-21: Django>=2.1,<2.2
15-
django-22: Django>=2.2,<2.3
16-
django-30: Django>=3.0,<3.1
17-
django-31: Django>=3.1,<3.2
1813
django-32: Django>=3.2,<3.3
19-
django-40: Django>=4.0,<4.1
2014
django-41: Django>=4.1,<4.2
15+
django-42: Django>=4.2,<4.3
2116
es64: elasticsearch-dsl>=6.4.0,<7.0.0
2217
es74: elasticsearch-dsl>=7.4.0,<8
2318
-r{toxinidir}/requirements_test.txt
2419

2520
basepython =
26-
py27: python2.7
27-
py36: python3.6
28-
py37: python3.7
2921
py38: python3.8
3022
py39: python3.9
3123
py310: python3.10

0 commit comments

Comments
 (0)