From 4eb522d992326c21f1a71da50da4128c21942676 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Tue, 7 Jan 2020 16:37:34 -0600 Subject: [PATCH 1/5] Moving from `django.utils.six` to `six` --- ajax_select/fields.py | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ajax_select/fields.py b/ajax_select/fields.py index 78157060a3..14dfdb8fa9 100644 --- a/ajax_select/fields.py +++ b/ajax_select/fields.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import json +from six import text_type from django import forms from django.conf import settings from django.contrib.contenttypes.models import ContentType @@ -11,7 +12,6 @@ from django.utils.encoding import force_text from django.utils.module_loading import import_string from django.utils.safestring import mark_safe -from django.utils.six import text_type from django.utils.translation import ugettext as _ from ajax_select.registry import registry diff --git a/setup.py b/setup.py index 5d6d22262c..5f8d7ff8b0 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ description="Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.", author="Chris Sattinger", author_email="crucialfelix@gmail.com", + install_requires=["six"], url="https://github.com/crucialfelix/django-ajax-selects/", packages=["ajax_select"], package_data={ From e440c8281d457a4a844363860b199b3aa22a2053 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Fri, 10 Jan 2020 12:10:18 -0600 Subject: [PATCH 2/5] Replacing deprecated `ugettext_` with `gettext_` --- ajax_select/fields.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ajax_select/fields.py b/ajax_select/fields.py index 14dfdb8fa9..d5e83f0836 100644 --- a/ajax_select/fields.py +++ b/ajax_select/fields.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import json +import sys from six import text_type from django import forms from django.conf import settings @@ -12,10 +13,14 @@ from django.utils.encoding import force_text from django.utils.module_loading import import_string from django.utils.safestring import mark_safe -from django.utils.translation import ugettext as _ from ajax_select.registry import registry +if sys.version_info.major >= 3: + from django.utils.translation import gettext as _ +else: + from django.utils.translation import ugettext as _ + try: from django.urls import reverse except ImportError: From 514eb4ec2ba08d369b848701ce831f44419cf128 Mon Sep 17 00:00:00 2001 From: Jake Bell Date: Fri, 10 Jan 2020 12:10:29 -0600 Subject: [PATCH 3/5] Adding Django 3 to test suite --- .travis.yml | 1 + tox.ini | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8eaf2c4af9..2a5c7e57cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ env: - TOX_ENV=py37-dj111 - TOX_ENV=py37-dj20 - TOX_ENV=py37-dj21 + - TOX_ENV=py37-dj30 before_install: - pyenv install 2.7 --skip-existing - pyenv install 3.7 --skip-existing diff --git a/tox.ini b/tox.ini index 834538efba..6f4e5a8e6b 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ envlist = {py27,py37}-flake8, {py27,py37}-{dj18,dj19,dj110,dj111} - py37-{dj20,dj21} + py37-{dj20,dj21,dj30} [testenv] setenv = @@ -22,6 +22,7 @@ deps = dj111: Django>=1.11.8,<1.12 dj20: Django>=2.0,<2.1 dj21: Django>=2.1,<2.2 + dj30: Django>=3,<3.1 ; djmaster: https://github.com/django/django/zipball/master [testenv:py27-flake8] From 193c0520dea7823fda747cfcd02f5ba18c543024 Mon Sep 17 00:00:00 2001 From: Chris Sattinger Date: Fri, 17 Jan 2020 10:17:36 +0100 Subject: [PATCH 4/5] Update requirements and compatibility for Django 3 --- README.md | 2 +- requirements-test.txt | 2 +- requirements.txt | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ada5a42b84..b0c9061731 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Read the full documention here: [outside of the admin](http://django-ajax-select ## Compatibility -* Django >=1.8, <3.0 +* Django >=1.8, <=3 * Python >=2.7, >=3.5 ## Contributors diff --git a/requirements-test.txt b/requirements-test.txt index 65ed40528f..323e8e33bd 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,6 @@ coverage>=4.4.1 coveralls>=1.1 -flake8>=3.3.0 +flake8>=3.7.0 tox>=2.8.0 sphinx>=1.6.1 sphinx_rtd_theme diff --git a/requirements.txt b/requirements.txt index f5651852ee..178a5f8c37 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -django>=1.8, <2.2 +django>=1.8, <=3 wheel>=0.29.0 diff --git a/setup.py b/setup.py index 5f8d7ff8b0..4c57ab8fd2 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ - Integrate with other UI elements elsewhere on the page using the javascript API - Works in Admin as well as in normal views -- Django >=1.8, <3.0 +- Django >=1.8, <=3 - Python >=2.7, >=3.5 """, ) From b127c8b9d86b2f7576cfe2d64e7bdc7ff1942e6f Mon Sep 17 00:00:00 2001 From: Chris Sattinger Date: Fri, 17 Jan 2020 10:17:52 +0100 Subject: [PATCH 5/5] chore: bump version to 1.9.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4c57ab8fd2..b0f97c2c3b 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="django-ajax-selects", - version="1.8.0", + version="1.9.0", description="Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.", author="Chris Sattinger", author_email="crucialfelix@gmail.com",