Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Mar 12, 2024
1 parent 97c3675 commit f59f149
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
python-version: ["3.9", "3.11"]
django-version: ["3.2", "4.2"]
open-dsl-version: ["2.1", "2.4"]
open-dsl-version: ["2.2", "2.4"]

exclude:
- python-version: "3.11"
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
- name: Run tests with Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} and opensearch-=py ${{ matrix.open-dsl-version }}
run: |
TOX_ENV=$(echo "py${{ matrix.python-version }}-django-${{ matrix.django-version }}-open${{ matrix.open-dsl-version }}" | tr -d .)
OPENSEARCH_URL=http://localhost:9200
python -m tox -e $TOX_ENV -- --elasticsearch
python -m tox -e $TOX_ENV -- --elasticsearch --signal-processor celery
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "(.idea|node_modules|.tox)"
repos:
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.15.0"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
2 changes: 1 addition & 1 deletion tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import django
from django.db import models
if django.VERSION < (4, 0):
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _
from six import python_2_unicode_compatible
Expand Down
2 changes: 1 addition & 1 deletion tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.db import models

if django.VERSION < (4, 0):
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _
from opensearchpy import GeoPoint, InnerDoc
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import django
from django.db.models.fields.files import FieldFile
if django.VERSION < (4, 0):
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import gettext_lazy as _
from mock import Mock, NonCallableMock
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{39}-django-{32,42}-{open21,open24}
py{311}-django-{41,42}-{open21,open24}
py{39}-django-{32,42}-{open22,open24}
py{311}-django-{41,42}-{open22,open24}


[testenv]
Expand All @@ -12,7 +12,7 @@ commands = coverage run --source django_elasticsearch_dsl runtests.py {posargs}
deps =
django-32: Django>=3.2,<3.3
django-42: Django>=4.2,<4.3
open21: opensearch-py>=2.1.0,<2.2.0
open22: opensearch-py>=2.2.0,<2.3.0
open24: opensearch-py>=2.4.0,<2.5.0
-r{toxinidir}/requirements_test.txt

Expand Down

0 comments on commit f59f149

Please sign in to comment.