From 7c8e7784a5faa99d8d3c64e64ecd0ed26acc8031 Mon Sep 17 00:00:00 2001 From: Irtaza Akram <51848298+irtazaakram@users.noreply.github.com> Date: Sun, 1 Oct 2023 22:59:07 +0500 Subject: [PATCH 01/13] feat: add support for support for Python/Django (#460) Co-authored-by: Safwan Rahman --- .github/workflows/ci.yml | 82 +++------------------------- README.rst | 9 +-- django_elasticsearch_dsl/__init__.py | 2 - requirements.txt | 2 +- requirements_dev.txt | 6 +- requirements_test.txt | 5 +- setup.py | 15 +---- tox.ini | 16 ++---- 8 files changed, 22 insertions(+), 115 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c633bb28..b70f8cf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,88 +7,20 @@ on: jobs: test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] - django-version: ["1.11", "2.0", "2.2", "2.1", "3.0", "3.1","3.2", "4.0", "4.1",] + python-version: ["3.8", "3.9", "3.10", "3.11"] + django-version: ["3.2", "4.1", "4.2"] es-dsl-version: ["6.4", "7.4"] es-version: ["7.13.4"] exclude: - - python-version: "2.7" - django-version: "2.0" - - python-version: "2.7" - django-version: "2.1" - - python-version: "2.7" - django-version: "2.2" - - python-version: "2.7" - django-version: "3.0" - - python-version: "2.7" - django-version: "3.1" - - python-version: "2.7" - django-version: "3.2" - - python-version: "2.7" - django-version: "4.0" - - python-version: "2.7" - django-version: "4.1" - - - python-version: "3.6" - django-version: "4.0" - - python-version: "3.6" - django-version: "4.1" - - - python-version: "3.7" - django-version: "4.0" - - python-version: "3.7" - django-version: "4.1" - - - python-version: "3.8" - django-version: "1.11" - - python-version: "3.8" - django-version: "2.0" - - python-version: "3.8" - django-version: "2.1" - - - python-version: "3.9" - django-version: "1.11" - - python-version: "3.9" - django-version: "2.0" - - python-version: "3.9" - django-version: "2.1" - - - python-version: "3.10" - django-version: "1.11" - - python-version: "3.10" - django-version: "2.0" - - python-version: "3.10" - django-version: "2.1" - - python-version: "3.10" - django-version: "2.2" - - python-version: "3.10" - django-version: "3.0" - - python-version: "3.10" - django-version: "3.1" - - - python-version: "3.11" - django-version: "1.11" - - python-version: "3.11" - django-version: "2.0" - - python-version: "3.11" - django-version: "2.1" - - python-version: "3.11" - django-version: "2.2" - - python-version: "3.11" - django-version: "3.0" - - python-version: "3.11" - django-version: "3.1" - python-version: "3.11" django-version: "3.2" - - python-version: "3.11" - django-version: "4.0" steps: - name: Install and Run Elasticsearch @@ -96,15 +28,15 @@ jobs: with: stack-version: ${{ matrix.es-version }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Cache Pip Dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('requirements_test.txt') }} @@ -125,4 +57,4 @@ jobs: python -m tox -e $TOX_ENV -- --elasticsearch --signal-processor celery - name: Publish Coverage Report - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 diff --git a/README.rst b/README.rst index 81c46f90..6ead8824 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ Features - Index fast using `parallel` indexing. - Requirements - - Django >= 1.11 - - Python 2.7, 3.5, 3.6, 3.7, 3.8 + - Django >= 3.2 + - Python 3.8, 3.9, 3.10, 3.11 **Elasticsearch Compatibility:** 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 - For Elasticsearch 6.0 and later, use the major version 6 (6.x.y) of the library. -- For Elasticsearch 5.0 and later, use the major version 0.5 (0.5.x) of the library. - .. code-block:: python # Elasticsearch 7.x @@ -51,7 +49,4 @@ The library is compatible with all Elasticsearch versions since 5.x # Elasticsearch 6.x elasticsearch-dsl>=6.0.0,<7.0.0 - # Elasticsearch 5.x - elasticsearch-dsl>=0.5.1,<6.0.0 - .. _Search: http://elasticsearch-dsl.readthedocs.io/en/stable/search_dsl.html diff --git a/django_elasticsearch_dsl/__init__.py b/django_elasticsearch_dsl/__init__.py index 109e0a48..04d7ad59 100644 --- a/django_elasticsearch_dsl/__init__.py +++ b/django_elasticsearch_dsl/__init__.py @@ -13,5 +13,3 @@ def autodiscover(): autodiscover_modules('documents') -if django.VERSION < (3, 2): - default_app_config = 'django_elasticsearch_dsl.apps.DEDConfig' diff --git a/requirements.txt b/requirements.txt index 77ddcb3f..32065b98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -django>=1.9.6 +django>=3.2 elasticsearch-dsl>=7.0.0,<8.0.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index f60740cb..43b5c3fe 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,6 +1,6 @@ -bumpversion==0.5.3 -wheel==0.32.2 -django>=2.0,<2.2 +bumpversion==0.6.0 +wheel==0.41.2 +django>=3.2 elasticsearch-dsl>=7.0.0,<8.0.0 twine sphinx diff --git a/requirements_test.txt b/requirements_test.txt index ba387ec5..683b5270 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,9 +1,8 @@ -coverage==4.1 +coverage==7.3.1 mock>=1.0.1 flake8>=2.1.0 tox>=1.7.0 -Pillow==6.2.0 +Pillow==10.0.0 celery>=4.1.0 - # Additional test requirements go here diff --git a/setup.py b/setup.py index cc6565ee..b6cad5f9 100755 --- a/setup.py +++ b/setup.py @@ -51,26 +51,17 @@ classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 1.11', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', - 'Framework :: Django :: 3.1', 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.1', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', ], extras_require={ 'celery': ["celery>=4.1.0"], diff --git a/tox.ini b/tox.ini index 2c62d204..54fd05f8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = - py27-django-111-es74 - {py36,py37,py38,py39,py310,py311}-django-{111,20,21,22,30,31,32,40,41}-{es64,es74} + py{38,39,310}-django-{32,41,42}-{es64,es74} + py{311}-django-{41,42}-{es64,es74} + [testenv] setenv = @@ -9,23 +10,14 @@ setenv = commands = coverage run --source django_elasticsearch_dsl runtests.py {posargs} deps = - django-111: Django>=1.11,<2.0 - django-20: Django>=2.0,<2.1 - django-21: Django>=2.1,<2.2 - django-22: Django>=2.2,<2.3 - django-30: Django>=3.0,<3.1 - django-31: Django>=3.1,<3.2 django-32: Django>=3.2,<3.3 - django-40: Django>=4.0,<4.1 django-41: Django>=4.1,<4.2 + django-42: Django>=4.2,<4.3 es64: elasticsearch-dsl>=6.4.0,<7.0.0 es74: elasticsearch-dsl>=7.4.0,<8 -r{toxinidir}/requirements_test.txt basepython = - py27: python2.7 - py36: python3.6 - py37: python3.7 py38: python3.8 py39: python3.9 py310: python3.10 From ae07e7f0bc93d4bc6bd65a3737a6455b192691d6 Mon Sep 17 00:00:00 2001 From: Timothy Oehrlein Date: Sun, 1 Oct 2023 20:57:13 +0200 Subject: [PATCH 02/13] Added support for Elasticsearch 8 (#458) * Updated Pillow version for compatibility with Python 3.8 * Updated alias actions to keyword arguments * Updated elasticsearch-dsl version in requirements * Updated tests * Updated documentation * Updated install requirements in setup.py * Update runtests.py * Update runtests.py * Update runtests.py * Update runtests.py --------- Co-authored-by: Safwan Rahman --- README.rst | 5 ++ .../management/commands/search_index.py | 6 +- docs/source/quickstart.rst | 5 +- example/requirements.txt | 2 +- requirements.txt | 2 +- runtests.py | 57 +++++++++++++++++-- setup.py | 2 +- tests/test_documents.py | 13 ++++- 8 files changed, 76 insertions(+), 16 deletions(-) diff --git a/README.rst b/README.rst index 6ead8824..eb29ad89 100644 --- a/README.rst +++ b/README.rst @@ -37,12 +37,17 @@ Features The library is compatible with all Elasticsearch versions since 5.x **but you have to use a matching major version:** +- For Elasticsearch 8.0 and later, use the major version 8 (8.x.y) of the library. + - For Elasticsearch 7.0 and later, use the major version 7 (7.x.y) of the library. - For Elasticsearch 6.0 and later, use the major version 6 (6.x.y) of the library. .. code-block:: python + # Elasticsearch 8.x + elasticsearch-dsl>=8.0.0,<9.0.0 + # Elasticsearch 7.x elasticsearch-dsl>=7.0.0,<8.0.0 diff --git a/django_elasticsearch_dsl/management/commands/search_index.py b/django_elasticsearch_dsl/management/commands/search_index.py index 4137c370..06bf8519 100644 --- a/django_elasticsearch_dsl/management/commands/search_index.py +++ b/django_elasticsearch_dsl/management/commands/search_index.py @@ -161,7 +161,7 @@ def _delete_alias_indices(self, alias): alias_delete_actions = [ {"remove_index": {"index": index}} for index in alias_indices ] - self.es_conn.indices.update_aliases({"actions": alias_delete_actions}) + self.es_conn.indices.update_aliases(actions=alias_delete_actions) for index in alias_indices: self.stdout.write("Deleted index '{}'".format(index)) @@ -231,7 +231,7 @@ def _update_alias(self, alias, new_index, alias_exists, options): {"remove_index": {"index": index}} for index in old_indices ] - self.es_conn.indices.update_aliases({"actions": alias_actions}) + self.es_conn.indices.update_aliases(actions=alias_actions) if delete_existing_index: self.stdout.write("Deleted index '{}'".format(alias)) @@ -247,7 +247,7 @@ def _update_alias(self, alias, new_index, alias_exists, options): if alias_delete_actions and not options['use_alias_keep_index']: self.es_conn.indices.update_aliases( - {"actions": alias_delete_actions} + actions=alias_delete_actions ) for index in old_indices: self.stdout.write("Deleted index '{}'".format(index)) diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index df7db5d5..f3b02b84 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -20,8 +20,9 @@ For example: ELASTICSEARCH_DSL={ 'default': { - 'hosts': 'localhost:9200' - }, + 'hosts': 'localhost:9200', + 'http_auth': ('username', 'password') + } } ``ELASTICSEARCH_DSL`` is then passed to ``elasticsearch-dsl-py.connections.configure`` (see here_). diff --git a/example/requirements.txt b/example/requirements.txt index 5cb1cf4a..2a45b67f 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -4,5 +4,5 @@ -e ../ django-autofixture==0.12.1 -Pillow==6.2.0 +Pillow==6.2.2 django==4.1.2 diff --git a/requirements.txt b/requirements.txt index 32065b98..53d79b32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ django>=3.2 -elasticsearch-dsl>=7.0.0,<8.0.0 +elasticsearch-dsl>=8.0.0,<9.0.0 diff --git a/runtests.py b/runtests.py index 43cc5178..11c60265 100644 --- a/runtests.py +++ b/runtests.py @@ -9,6 +9,27 @@ from django.test.utils import get_runner def get_settings(signal_processor): + elasticsearch_dsl_default_settings = { + 'hosts': os.environ.get( + 'ELASTICSEARCH_URL', + 'https://127.0.0.1:9200' + ), + 'basic_auth': ( + os.environ.get('ELASTICSEARCH_USERNAME'), + os.environ.get('ELASTICSEARCH_PASSWORD') + ) + } + + elasticsearch_certs_path = os.environ.get( + 'ELASTICSEARCH_CERTS_PATH' + ) + if elasticsearch_certs_path: + elasticsearch_dsl_default_settings['ca_certs'] = ( + elasticsearch_certs_path + ) + else: + elasticsearch_dsl_default_settings['verify_certs'] = False + PROCESSOR_CLASSES = { 'realtime': 'django_elasticsearch_dsl.signals.RealTimeSignalProcessor', 'celery': 'django_elasticsearch_dsl.signals.CelerySignalProcessor', @@ -33,10 +54,7 @@ def get_settings(signal_processor): SITE_ID=1, MIDDLEWARE_CLASSES=(), ELASTICSEARCH_DSL={ - 'default': { - 'hosts': os.environ.get('ELASTICSEARCH_URL', - '127.0.0.1:9200') - }, + 'default': elasticsearch_dsl_default_settings }, DEFAULT_AUTO_FIELD="django.db.models.BigAutoField", CELERY_BROKER_URL='memory://localhost/', @@ -81,13 +99,42 @@ def make_parser(): choices=('realtime', 'celery'), help='Defines which signal backend to choose' ) + parser.add_argument( + '--elasticsearch-username', + nargs='?', + help="Username for Elasticsearch user" + ) + parser.add_argument( + '--elasticsearch-password', + nargs='?', + help="Password for Elasticsearch user" + ) + parser.add_argument( + '--elasticsearch-certs-path', + nargs='?', + help="Path to CA certificates for Elasticsearch" + ) return parser def run_tests(*test_args): args, test_args = make_parser().parse_known_args(test_args) if args.elasticsearch: - os.environ.setdefault('ELASTICSEARCH_URL', args.elasticsearch) + os.environ.setdefault('ELASTICSEARCH_URL', "https://127.0.0.1:9200") + + username = args.elasticsearch_username or "elastic" + password = args.elasticsearch_password or "changeme" + os.environ.setdefault( + 'ELASTICSEARCH_USERNAME', username + ) + os.environ.setdefault( + 'ELASTICSEARCH_PASSWORD', password + ) + + if args.elasticsearch_certs_path: + os.environ.setdefault( + 'ELASTICSEARCH_CERTS_PATH', args.elasticsearch_certs_path + ) if not test_args: test_args = ['tests'] diff --git a/setup.py b/setup.py index b6cad5f9..583ddd53 100755 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ ], include_package_data=True, install_requires=[ - 'elasticsearch-dsl>=7.2.0,<8.0.0', + 'elasticsearch-dsl>=8.9.0,<9.0.0', 'six', ], license="Apache Software License 2.0", diff --git a/tests/test_documents.py b/tests/test_documents.py index 40c36ce1..568e45b9 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -508,8 +508,8 @@ def generate_id(cls, article): # Get the data from the elasticsearch low level API because # The generator get executed there. - data = json.loads(mock_bulk.call_args[1]['body'].split("\n")[0]) - assert data["index"]["_id"] == article.slug + data = json.loads(mock_bulk.call_args[1]['operations'][1]) + assert data['slug'] == article.slug @patch('elasticsearch_dsl.connections.Elasticsearch.bulk') def test_should_index_object_is_called(self, mock_bulk): @@ -549,6 +549,13 @@ def should_index_object(self, obj): d = ArticleDocument() d.update([article1, article2]) + operations = mock_bulk.call_args[1]['operations'] + slugs = [ + json.loads(operation)['slug'] for operation in operations + if 'slug' in json.loads(operation) + ] + self.assertTrue(article1.slug in slugs) + self.assertTrue(article2.slug not in slugs) data_body = mock_bulk.call_args[1]['body'] self.assertTrue(article1.slug in data_body) self.assertTrue(article2.slug not in data_body) @@ -558,4 +565,4 @@ class RealTimeDocTypeTestCase(BaseDocTypeTestCase, TestCase): class CeleryDocTypeTestCase(BaseDocTypeTestCase, TestCase): - TARGET_PROCESSOR = 'django_elasticsearch_dsl.signals.CelerySignalProcessor' + TARGET_PROCESSOR = 'django_elasticsearch_dsl.signals.CelerySignalProcessor' \ No newline at end of file From c05b9e2c3f8f1e372ffdadc7f4e45a30c988b097 Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Mon, 2 Oct 2023 00:58:31 +0600 Subject: [PATCH 03/13] Upgrading ES to 8 in Github CI --- .github/workflows/ci.yml | 2 +- runtests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b70f8cf2..b384d056 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] django-version: ["3.2", "4.1", "4.2"] es-dsl-version: ["6.4", "7.4"] - es-version: ["7.13.4"] + es-version: ["8.10.2"] exclude: - python-version: "3.11" diff --git a/runtests.py b/runtests.py index 11c60265..0b613389 100644 --- a/runtests.py +++ b/runtests.py @@ -29,7 +29,7 @@ def get_settings(signal_processor): ) else: elasticsearch_dsl_default_settings['verify_certs'] = False - + PROCESSOR_CLASSES = { 'realtime': 'django_elasticsearch_dsl.signals.RealTimeSignalProcessor', 'celery': 'django_elasticsearch_dsl.signals.CelerySignalProcessor', From 6f6e4c82d3692d0b796657a6e7bd7b6942e8d0b9 Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Mon, 2 Oct 2023 01:04:02 +0600 Subject: [PATCH 04/13] Fixing tests --- tests/test_documents.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/test_documents.py b/tests/test_documents.py index 568e45b9..d7dd2ac7 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -556,13 +556,10 @@ def should_index_object(self, obj): ] self.assertTrue(article1.slug in slugs) self.assertTrue(article2.slug not in slugs) - data_body = mock_bulk.call_args[1]['body'] - self.assertTrue(article1.slug in data_body) - self.assertTrue(article2.slug not in data_body) class RealTimeDocTypeTestCase(BaseDocTypeTestCase, TestCase): TARGET_PROCESSOR = 'django_elasticsearch_dsl.signals.RealTimeSignalProcessor' class CeleryDocTypeTestCase(BaseDocTypeTestCase, TestCase): - TARGET_PROCESSOR = 'django_elasticsearch_dsl.signals.CelerySignalProcessor' \ No newline at end of file + TARGET_PROCESSOR = 'django_elasticsearch_dsl.signals.CelerySignalProcessor' From 44b25a44904722b83a5bb40aa3d26a5dd868542e Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Mon, 2 Oct 2023 01:10:28 +0600 Subject: [PATCH 05/13] Bumping version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 583ddd53..c54c35e0 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from distutils.core import setup -version = '7.4' +version = '8.0' if sys.argv[-1] == 'publish': try: From a51c13f7978eb618e00c2152cef57323aa56172e Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Mon, 2 Oct 2023 01:19:16 +0600 Subject: [PATCH 06/13] Adding python minimum version --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c54c35e0..a3c60e1b 100755 --- a/setup.py +++ b/setup.py @@ -33,6 +33,7 @@ setup( name='django-elasticsearch-dsl', version=version, + python_requires=">=3.8", description="""Wrapper around elasticsearch-dsl-py for django models""", long_description=readme + '\n\n' + history, author='Sabricot', From e453afffe024725be27e457cdf67b1e8229bccfe Mon Sep 17 00:00:00 2001 From: James Addison <55152140+jayaddison@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:59:30 +0000 Subject: [PATCH 07/13] [docs] Sphinx v8 compatibility: configure a non-empty inventory name for Python in `intersphinx_mapping`. (#485) --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 21e7a789..8cad968b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -299,7 +299,7 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - '': ('https://docs.python.org/', None), + 'python': ('https://docs.python.org/', None), 'es-py': ('https://elasticsearch-py.readthedocs.io/en/master/', None) , 'es-dsl': ('https://elasticsearch-dsl.readthedocs.io/en/latest/', None), } From eb2f181c0ac673930b4c3b7cf78c2f559188cf26 Mon Sep 17 00:00:00 2001 From: Sandile Lungelo Ximba Date: Mon, 23 Jun 2025 00:31:03 +0200 Subject: [PATCH 08/13] Restrict version of elasticsearch-dsl-py to <= 8.17.1 (#498) This commit pins the dependency of elasticsearch-dsl-py to <= 8.17.1 because after this version elasticsearch-dsl-py is deprecated and merged into elasticsearch-py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a3c60e1b..cd6153c9 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ ], include_package_data=True, install_requires=[ - 'elasticsearch-dsl>=8.9.0,<9.0.0', + 'elasticsearch-dsl>=8.9.0,<=8.17.1', 'six', ], license="Apache Software License 2.0", From 7e6bb28d04b777b368f256db59b8a301fb94c89e Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Tue, 24 Jun 2025 04:14:23 +0600 Subject: [PATCH 09/13] Bumping version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cd6153c9..43fba834 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from distutils.core import setup -version = '8.0' +version = '8.1' if sys.argv[-1] == 'publish': try: From 9cee0e341fe08b95fc09f2447657841fbc060e23 Mon Sep 17 00:00:00 2001 From: Sandile Lungelo Ximba Date: Tue, 24 Jun 2025 00:27:09 +0200 Subject: [PATCH 10/13] Switch from elasticsearch-dsl-py dependency to elasticsearch-py (#499) This commit switches the dependency of this library from elasticsearch-dsl-py to elasticsearch-py since the former was merged into the latter. --- .github/workflows/ci.yml | 2 +- README.rst | 8 ++-- django_elasticsearch_dsl/apps.py | 3 +- django_elasticsearch_dsl/documents.py | 8 ++-- django_elasticsearch_dsl/fields.py | 45 +++++++------------ django_elasticsearch_dsl/indices.py | 2 +- .../management/commands/search_index.py | 6 ++- django_elasticsearch_dsl/registries.py | 9 ++-- django_elasticsearch_dsl/search.py | 3 +- django_elasticsearch_dsl/test/testcases.py | 2 +- docs/source/es_index.rst | 4 +- example/test_app/documents.py | 4 +- requirements.txt | 2 +- requirements_dev.txt | 4 +- setup.py | 2 +- tests/__init__.py | 2 +- tests/documents.py | 5 ++- tests/test_documents.py | 23 +++++----- tests/test_integration.py | 20 +++++---- 19 files changed, 73 insertions(+), 81 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b384d056..4a97852a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] django-version: ["3.2", "4.1", "4.2"] es-dsl-version: ["6.4", "7.4"] - es-version: ["8.10.2"] + es-version: ["9.0.2"] exclude: - python-version: "3.11" diff --git a/README.rst b/README.rst index eb29ad89..d0b41ea7 100644 --- a/README.rst +++ b/README.rst @@ -12,17 +12,17 @@ Django Elasticsearch DSL :target: https://django-elasticsearch-dsl.readthedocs.io/en/latest/ Django Elasticsearch DSL is a package that allows indexing of django models in elasticsearch. -It is built as a thin wrapper around elasticsearch-dsl-py_ -so you can use all the features developed by the elasticsearch-dsl-py team. +It is built as a thin wrapper around elasticsearch-py_ +so you can use all the features developed by the elasticsearch-py team. You can view the full documentation at https://django-elasticsearch-dsl.readthedocs.io -.. _elasticsearch-dsl-py: https://github.com/elastic/elasticsearch-dsl-py +.. _elasticsearch-py: https://github.com/elastic/elasticsearch-py Features -------- -- Based on elasticsearch-dsl-py_ so you can make queries with the Search_ class. +- Based on elasticsearch-py_ so you can make queries with the Search_ class. - Django signal receivers on save and delete for keeping Elasticsearch in sync. - Management commands for creating, deleting, rebuilding and populating indices. - Elasticsearch auto mapping from django models fields. diff --git a/django_elasticsearch_dsl/apps.py b/django_elasticsearch_dsl/apps.py index 73e451c3..1b3f5eb4 100644 --- a/django_elasticsearch_dsl/apps.py +++ b/django_elasticsearch_dsl/apps.py @@ -1,8 +1,7 @@ from django.apps import AppConfig from django.conf import settings from django.utils.module_loading import import_string - -from elasticsearch_dsl.connections import connections +from elasticsearch.dsl.connections import connections class DEDConfig(AppConfig): diff --git a/django_elasticsearch_dsl/documents.py b/django_elasticsearch_dsl/documents.py index 4671064d..79848b74 100644 --- a/django_elasticsearch_dsl/documents.py +++ b/django_elasticsearch_dsl/documents.py @@ -6,8 +6,8 @@ from django import VERSION as DJANGO_VERSION from django.db import models +from elasticsearch.dsl import Document as DSLDocument from elasticsearch.helpers import bulk, parallel_bulk -from elasticsearch_dsl import Document as DSLDocument from six import iteritems from .exceptions import ModelFieldNotMappedError @@ -21,7 +21,8 @@ KeywordField, LongField, ShortField, - TextField, TimeField, + TextField, + TimeField, ) from .search import Search from .signals import post_index @@ -219,14 +220,13 @@ def _get_actions(self, object_list, action): for object_instance in object_list: if action == 'delete' or self.should_index_object(object_instance): yield self._prepare_action(object_instance, action) - + def get_actions(self, object_list, action): """ Generate the elasticsearch payload. """ return self._get_actions(object_list, action) - def _bulk(self, *args, **kwargs): """Helper for switching between normal and parallel bulk operation""" parallel = kwargs.pop('parallel', False) diff --git a/django_elasticsearch_dsl/fields.py b/django_elasticsearch_dsl/fields.py index 2652b68e..ced770ce 100644 --- a/django_elasticsearch_dsl/fields.py +++ b/django_elasticsearch_dsl/fields.py @@ -9,8 +9,9 @@ from django.utils.encoding import force_text as force_str else: from django.utils.encoding import force_str + from django.utils.functional import Promise -from elasticsearch_dsl.field import ( +from elasticsearch.dsl.field import ( Boolean, Byte, Completion, @@ -22,14 +23,14 @@ GeoShape, Integer, Ip, + Keyword, Long, Nested, Object, ScaledFloat, + SearchAsYouType, Short, - Keyword, Text, - SearchAsYouType, ) from .exceptions import VariableLookupError @@ -100,36 +101,24 @@ class ObjectField(DEDField, Object): def _get_inner_field_data(self, obj, field_value_to_ignore=None): data = {} - if hasattr(self, 'properties'): - for name, field in self.properties.to_dict().items(): - if not isinstance(field, DEDField): - continue + doc_instance = self._doc_class() + for name, field in self._doc_class._doc_type.mapping.properties._params.get( + 'properties', {}).items(): # noqa + if not isinstance(field, DEDField): + continue + + if field._path == []: + field._path = [name] - if field._path == []: - field._path = [name] + # This allows for retrieving data from an InnerDoc with prepare_field_name functions. + prep_func = getattr(doc_instance, 'prepare_%s' % name, None) + if prep_func: + data[name] = prep_func(obj) + else: data[name] = field.get_value_from_instance( obj, field_value_to_ignore ) - else: - doc_instance = self._doc_class() - for name, field in self._doc_class._doc_type.mapping.properties._params.get( - 'properties', {}).items(): # noqa - if not isinstance(field, DEDField): - continue - - if field._path == []: - field._path = [name] - - # This allows for retrieving data from an InnerDoc with prepare_field_name functions. - prep_func = getattr(doc_instance, 'prepare_%s' % name, None) - - if prep_func: - data[name] = prep_func(obj) - else: - data[name] = field.get_value_from_instance( - obj, field_value_to_ignore - ) # This allows for ObjectFields to be indexed from dicts with # dynamic keys (i.e. keys/fields not defined in 'properties') diff --git a/django_elasticsearch_dsl/indices.py b/django_elasticsearch_dsl/indices.py index 115874d5..b2a1ef79 100644 --- a/django_elasticsearch_dsl/indices.py +++ b/django_elasticsearch_dsl/indices.py @@ -1,6 +1,6 @@ from copy import deepcopy -from elasticsearch_dsl import Index as DSLIndex +from elasticsearch.dsl import Index as DSLIndex from six import python_2_unicode_compatible from .apps import DEDConfig diff --git a/django_elasticsearch_dsl/management/commands/search_index.py b/django_elasticsearch_dsl/management/commands/search_index.py index 06bf8519..a70b10ee 100644 --- a/django_elasticsearch_dsl/management/commands/search_index.py +++ b/django_elasticsearch_dsl/management/commands/search_index.py @@ -1,10 +1,12 @@ -from __future__ import unicode_literals, absolute_import +from __future__ import absolute_import, unicode_literals + from datetime import datetime -from elasticsearch_dsl import connections from django.conf import settings from django.core.management.base import BaseCommand, CommandError +from elasticsearch.dsl import connections from six.moves import input + from ...registries import registry diff --git a/django_elasticsearch_dsl/registries.py b/django_elasticsearch_dsl/registries.py index e2623ddd..4c57fa43 100644 --- a/django_elasticsearch_dsl/registries.py +++ b/django_elasticsearch_dsl/registries.py @@ -1,14 +1,13 @@ from collections import defaultdict from copy import deepcopy - from itertools import chain -from django.core.exceptions import ObjectDoesNotExist -from django.core.exceptions import ImproperlyConfigured -from elasticsearch_dsl import AttrDict -from six import itervalues, iterkeys, iteritems +from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist +from elasticsearch.dsl import AttrDict +from six import iteritems, iterkeys, itervalues from django_elasticsearch_dsl.exceptions import RedeclaredFieldError + from .apps import DEDConfig diff --git a/django_elasticsearch_dsl/search.py b/django_elasticsearch_dsl/search.py index bc66d82e..db969cc5 100644 --- a/django_elasticsearch_dsl/search.py +++ b/django_elasticsearch_dsl/search.py @@ -1,7 +1,6 @@ from django.db.models import Case, When from django.db.models.fields import IntegerField - -from elasticsearch_dsl import Search as DSLSearch +from elasticsearch.dsl import Search as DSLSearch class Search(DSLSearch): diff --git a/django_elasticsearch_dsl/test/testcases.py b/django_elasticsearch_dsl/test/testcases.py index 12c3a802..43787b22 100644 --- a/django_elasticsearch_dsl/test/testcases.py +++ b/django_elasticsearch_dsl/test/testcases.py @@ -1,7 +1,7 @@ import re from django.test.utils import captured_stderr -from elasticsearch_dsl.connections import connections +from elasticsearch.dsl.connections import connections from ..registries import registry diff --git a/docs/source/es_index.rst b/docs/source/es_index.rst index 618856dc..963d3db9 100644 --- a/docs/source/es_index.rst +++ b/docs/source/es_index.rst @@ -4,7 +4,7 @@ Index In typical scenario using `class Index` on a `Document` class is sufficient to perform any action. In a few cases though it can be useful to manipulate an Index object directly. -To define an Elasticsearch index you must instantiate a ``elasticsearch_dsl.Index`` class +To define an Elasticsearch index you must instantiate a ``elasticsearch.dsl.Index`` class and set the name and settings of the index. After you instantiate your class, you need to associate it with the Document you want to put in this Elasticsearch index @@ -14,7 +14,7 @@ and also add the `registry.register_document` decorator. .. code-block:: python # documents.py - from elasticsearch_dsl import Index + from elasticsearch.dsl import Index from django_elasticsearch_dsl import Document from .models import Car, Manufacturer diff --git a/example/test_app/documents.py b/example/test_app/documents.py index e1e449d9..fa3cd10c 100644 --- a/example/test_app/documents.py +++ b/example/test_app/documents.py @@ -1,10 +1,10 @@ -from elasticsearch_dsl import analyzer +from elasticsearch.dsl import analyzer + from django_elasticsearch_dsl import Document, Index, fields from django_elasticsearch_dsl.registries import registry from .models import Ad, Car, Manufacturer - car = Index('test_cars') car.settings( number_of_shards=1, diff --git a/requirements.txt b/requirements.txt index 53d79b32..c3050eb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ django>=3.2 -elasticsearch-dsl>=8.0.0,<9.0.0 +elasticsearch>=8.18.0,<9.0.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index 43b5c3fe..e8033a82 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ bumpversion==0.6.0 -wheel==0.41.2 +wheel==0.45.1 django>=3.2 -elasticsearch-dsl>=7.0.0,<8.0.0 +elasticsearch>=8.18.0,<9.0.0 twine sphinx -e . diff --git a/setup.py b/setup.py index 43fba834..64c447b8 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ ], include_package_data=True, install_requires=[ - 'elasticsearch-dsl>=8.9.0,<=8.17.1', + 'elasticsearch>=8.18.0,<9.0.0', 'six', ], license="Apache Software License 2.0", diff --git a/tests/__init__.py b/tests/__init__.py index 7f06df26..4e452429 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,3 @@ -from elasticsearch_dsl import VERSION +from elasticsearch import VERSION ES_MAJOR_VERSION = VERSION[0] diff --git a/tests/documents.py b/tests/documents.py index 08ef83f1..ea157499 100644 --- a/tests/documents.py +++ b/tests/documents.py @@ -1,8 +1,9 @@ -from elasticsearch_dsl import analyzer +from elasticsearch.dsl import analyzer + from django_elasticsearch_dsl import Document, fields from django_elasticsearch_dsl.registries import registry -from .models import Ad, Category, Car, Manufacturer, Article +from .models import Ad, Article, Car, Category, Manufacturer index_settings = { 'number_of_shards': 1, diff --git a/tests/test_documents.py b/tests/test_documents.py index d7dd2ac7..15984bb0 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -1,7 +1,5 @@ import json -from unittest import TestCase -from unittest import SkipTest - +from unittest import SkipTest, TestCase import django from django.db import models @@ -10,13 +8,16 @@ from django.utils.translation import ugettext_lazy as _ else: from django.utils.translation import gettext_lazy as _ -from elasticsearch_dsl import GeoPoint, InnerDoc -from mock import patch, Mock + +from elasticsearch.dsl import GeoPoint, InnerDoc +from mock import Mock, patch from django_elasticsearch_dsl import fields from django_elasticsearch_dsl.documents import DocType -from django_elasticsearch_dsl.exceptions import (ModelFieldNotMappedError, - RedeclaredFieldError) +from django_elasticsearch_dsl.exceptions import ( + ModelFieldNotMappedError, + RedeclaredFieldError, +) from django_elasticsearch_dsl.registries import registry from tests import ES_MAJOR_VERSION @@ -453,7 +454,7 @@ def test_init_prepare_results(self): # got iterated and generate_id called. # If we mock the bulk in django_elasticsearch_dsl.document # the actual bulk will be never called and the test will fail - @patch('elasticsearch_dsl.connections.Elasticsearch.bulk') + @patch('elasticsearch.dsl.connections.Elasticsearch.bulk') def test_default_generate_id_is_called(self, _): article = Article( id=124594, @@ -481,7 +482,7 @@ class Index: d.update(article) patched_method.assert_called() - @patch('elasticsearch_dsl.connections.Elasticsearch.bulk') + @patch('elasticsearch.dsl.connections.Elasticsearch.bulk') def test_custom_generate_id_is_called(self, mock_bulk): article = Article( id=54218, @@ -511,7 +512,7 @@ def generate_id(cls, article): data = json.loads(mock_bulk.call_args[1]['operations'][1]) assert data['slug'] == article.slug - @patch('elasticsearch_dsl.connections.Elasticsearch.bulk') + @patch('elasticsearch.dsl.connections.Elasticsearch.bulk') def test_should_index_object_is_called(self, mock_bulk): doc = CarDocument() car1 = Car() @@ -525,7 +526,7 @@ def test_should_index_object_is_called(self, mock_bulk): self.assertEqual(mock_should_index_object.call_count, 3, "should_index_object is called") - @patch('elasticsearch_dsl.connections.Elasticsearch.bulk') + @patch('elasticsearch.dsl.connections.Elasticsearch.bulk') def test_should_index_object_working_perfectly(self, mock_bulk): article1 = Article(slug='article1') article2 = Article(slug='article2') diff --git a/tests/test_integration.py b/tests/test_integration.py index f01d5781..254129c7 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,31 +1,33 @@ -from datetime import datetime import unittest +from datetime import datetime import django from django.core.management import call_command from django.test import TestCase, TransactionTestCase + if django.VERSION < (4, 0): from django.utils.translation import ugettext_lazy as _ else: from django.utils.translation import gettext_lazy as _ -from six import StringIO +from elasticsearch.dsl import Index as DSLIndex from elasticsearch.exceptions import NotFoundError -from elasticsearch_dsl import Index as DSLIndex +from six import StringIO + from django_elasticsearch_dsl.test import ESTestCase, is_es_online from tests import ES_MAJOR_VERSION from .documents import ( - ad_index, AdDocument, - car_index, - CarDocument, - CarWithPrepareDocument, ArticleDocument, ArticleWithSlugAsIdDocument, - index_settings + CarDocument, + CarWithPrepareDocument, + ad_index, + car_index, + index_settings, ) -from .models import Car, Manufacturer, Ad, Category, Article, COUNTRIES +from .models import COUNTRIES, Ad, Article, Car, Category, Manufacturer @unittest.skipUnless(is_es_online(), 'Elasticsearch is offline') From 97de23a07d56d14728b50d6b7d85afd03485b8fb Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Tue, 24 Jun 2025 04:30:46 +0600 Subject: [PATCH 11/13] Bumping version 8.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 64c447b8..6a4b8347 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from distutils.core import setup -version = '8.1' +version = '8.2' if sys.argv[-1] == 'publish': try: From 378f772caee634a51939477dcec915866de6e86d Mon Sep 17 00:00:00 2001 From: Sandile Lungelo Ximba Date: Tue, 8 Jul 2025 20:03:42 +0200 Subject: [PATCH 12/13] Add support for ES9 and drop unsupported dependencies (#500) This commit adds support for elasticsearch-py 9.x and it also drops support for older and unsupported versions of python and django --- .github/workflows/ci.yml | 28 +++++++++++++++++++--------- .readthedocs.yml | 2 +- README.rst | 9 +++++++-- requirements.txt | 4 ++-- requirements_dev.txt | 4 ++-- requirements_test.txt | 10 +++++----- setup.py | 14 ++++++++------ tox.ini | 23 ++++++++++------------- 8 files changed, 54 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a97852a..30f18ff4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,25 @@ jobs: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - django-version: ["3.2", "4.1", "4.2"] - es-dsl-version: ["6.4", "7.4"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + django-version: ["4.2", "4.2.8", "5.0", "5.1", "5.1.3", "5.2"] es-version: ["9.0.2"] exclude: - - python-version: "3.11" - django-version: "3.2" + - django-version: "4.2" + python-version: "3.12" + - django-version: "4.2" + python-version: "3.13" + - django-version: "4.2.8" + python-version: "3.13" + - django-version: "5.0" + python-version: "3.9" + - django-version: "5.1" + python-version: "3.9" + - django-version: "5.1.3" + python-version: "3.9" + - django-version: "5.2" + python-version: "3.9" steps: - name: Install and Run Elasticsearch @@ -31,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - name: Install Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -47,12 +58,11 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install "Django==${{ matrix.django-version }}" - python -m pip install "elasticsearch-dsl==${{ matrix.es-dsl-version }}" python -m pip install -r requirements_test.txt - - name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and elasticsearch-dsl-py ${{ matrix.es-dsl-version }} + - name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} run: | - TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-es${{ matrix.es-dsl-version }}" | tr -d .) + TOX_ENV=$(echo "py${{ matrix.python-version }}-dj${{ matrix.django-version }}" | tr -d .) python -m tox -e $TOX_ENV -- --elasticsearch python -m tox -e $TOX_ENV -- --elasticsearch --signal-processor celery diff --git a/.readthedocs.yml b/.readthedocs.yml index b5f97cfb..8fa81a9d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,4 +6,4 @@ sphinx: formats: all python: - version: 3.8 + version: 3.9 diff --git a/README.rst b/README.rst index d0b41ea7..11dfcfc5 100644 --- a/README.rst +++ b/README.rst @@ -30,13 +30,15 @@ Features - Index fast using `parallel` indexing. - Requirements - - Django >= 3.2 - - Python 3.8, 3.9, 3.10, 3.11 + - Django >= 4.2 + - Python 3.9, 3.10, 3.11, 3.12, 3.13 **Elasticsearch Compatibility:** The library is compatible with all Elasticsearch versions since 5.x **but you have to use a matching major version:** +- For Elasticsearch 9.0 and later, use the major version 9 (9.x.y) of the library. + - For Elasticsearch 8.0 and later, use the major version 8 (8.x.y) of the library. - For Elasticsearch 7.0 and later, use the major version 7 (7.x.y) of the library. @@ -45,6 +47,9 @@ The library is compatible with all Elasticsearch versions since 5.x .. code-block:: python + # Elasticsearch 9.x + elasticsearch>=9.0.0,<10.0.0 + # Elasticsearch 8.x elasticsearch-dsl>=8.0.0,<9.0.0 diff --git a/requirements.txt b/requirements.txt index c3050eb3..d931be5b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -django>=3.2 -elasticsearch>=8.18.0,<9.0.0 +django>=4.2 +elasticsearch>=9.0.0,<10.0.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index e8033a82..ee2faebc 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,7 +1,7 @@ bumpversion==0.6.0 wheel==0.45.1 -django>=3.2 -elasticsearch>=8.18.0,<9.0.0 +django>=4.2 +elasticsearch>=9.0.0,<10.0.0 twine sphinx -e . diff --git a/requirements_test.txt b/requirements_test.txt index 683b5270..66ca4312 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,8 +1,8 @@ -coverage==7.3.1 -mock>=1.0.1 -flake8>=2.1.0 +coverage>=7.9.1 +mock>=5.2.0 +flake8>=7.3.0 tox>=1.7.0 -Pillow==10.0.0 -celery>=4.1.0 +Pillow>=11.0.0 +celery>=5.5.3 # Additional test requirements go here diff --git a/setup.py b/setup.py index 6a4b8347..015ba82d 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( name='django-elasticsearch-dsl', version=version, - python_requires=">=3.8", + python_requires=">=3.9", description="""Wrapper around elasticsearch-dsl-py for django models""", long_description=readme + '\n\n' + history, author='Sabricot', @@ -43,7 +43,7 @@ ], include_package_data=True, install_requires=[ - 'elasticsearch>=8.18.0,<9.0.0', + 'elasticsearch>=9.0.0,<10.0.0', 'six', ], license="Apache Software License 2.0", @@ -52,19 +52,21 @@ classifiers=[ 'Development Status :: 3 - Alpha', 'Framework :: Django', - 'Framework :: Django :: 3.2', - 'Framework :: Django :: 4.1', 'Framework :: Django :: 4.2', + 'Framework :: Django :: 5.0', + 'Framework :: Django :: 5.1', + 'Framework :: Django :: 5.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ], extras_require={ - 'celery': ["celery>=4.1.0"], + 'celery': ["celery>=5.5.3"], } ) diff --git a/tox.ini b/tox.ini index 54fd05f8..b8dfb52d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,9 @@ [tox] envlist = - py{38,39,310}-django-{32,41,42}-{es64,es74} - py{311}-django-{41,42}-{es64,es74} + py{39,310,311}-dj{42} + py{39,310,311,312}-dj{428} + py{310,311,312}-dj{50,51} + py{310,311,312,313}-dj{513,52} [testenv] @@ -10,15 +12,10 @@ setenv = commands = coverage run --source django_elasticsearch_dsl runtests.py {posargs} deps = - django-32: Django>=3.2,<3.3 - django-41: Django>=4.1,<4.2 - django-42: Django>=4.2,<4.3 - es64: elasticsearch-dsl>=6.4.0,<7.0.0 - es74: elasticsearch-dsl>=7.4.0,<8 + dj42: Django>=4.2,<4.2.8 + dj428: Django>=4.2.8,<5.0 + dj50: Django>=5.0,<5.1 + dj51: Django>=5.1,<5.1.3 + dj513: Django>=5.1.3,<5.2 + dj52: Django>=5.2,<5.3 -r{toxinidir}/requirements_test.txt - -basepython = - py38: python3.8 - py39: python3.9 - py310: python3.10 - py311: python3.11 From 49cea31ca1e6c19eda868c4026f505bbdeffe9f7 Mon Sep 17 00:00:00 2001 From: Safwan Rahman Date: Thu, 24 Jul 2025 04:47:38 +0600 Subject: [PATCH 13/13] Bumping version 9.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 015ba82d..e372121d 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ except ImportError: from distutils.core import setup -version = '8.2' +version = '9.0' if sys.argv[-1] == 'publish': try: