diff --git a/.travis.yml b/.travis.yml index 31b04442..3bf7db9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,10 @@ matrix: env: TOXENV=py37-django22-sqlite - python: 3.7 env: TOXENV=py37-django30-sqlite + - python: 3.7 + env: TOXENV=py37-django31-sqlite - python: 3.8 - env: TOXENV=py38-django30-sqlite + env: TOXENV=py38-django31-sqlite - python: 3.7 env: TOXENV=py37-djangodev-sqlite - python: 3.7 diff --git a/AUTHORS b/AUTHORS index 8b36b969..e9b31b31 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,3 +17,4 @@ - Charles Sartori @csarcom - Aaron VanDerlip @aaronvanderlip - Chris Vigelius @chrisv2 +- Mariano Ramirez @marianoeramirez diff --git a/CHANGELOG b/CHANGELOG index 931a3cca..0ef41eef 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2020-08-06 3.7.0 + Fix for subregion + Drop support for python 2 + Changes dependency from django-autoslug-iplweb to django-autoslug, that + works with Django 3.1 + 2019-04-14 3.6.0 Add Subregion support by @adamb70 and @Guts diff --git a/README.rst b/README.rst index 157b911b..d3741d7c 100644 --- a/README.rst +++ b/README.rst @@ -29,8 +29,8 @@ database, you should use Requirements: -- Python 2.7 or 3.3, -- Django >= 1.8 +- Python >= 3.6 +- Django >= 1.11 - MySQL or PostgreSQL or SQLite. Yes, for some reason, code that used to work on MySQL (not without pain xD) @@ -122,11 +122,11 @@ Running the full test suite:: To run the tests in specific environment use the following command:: - tox -e py27-django18-sqlite + tox -e py37-django31-sqlite And to run one specific test use this one:: - tox -e py27-django18-sqlite -- cities_light/tests/test_form.py::FormTestCase::testCountryFormNameAndContinentAlone + tox -e py37-django31-sqlite -- cities_light/tests/test_form.py::FormTestCase::testCountryFormNameAndContinentAlone To run it even faster, you can switch to specific tox virtualenv:: diff --git a/cities_light/abstract_models.py b/cities_light/abstract_models.py index 3da9cc79..106d82da 100644 --- a/cities_light/abstract_models.py +++ b/cities_light/abstract_models.py @@ -5,8 +5,6 @@ import autoslug import pytz -from six import python_2_unicode_compatible - from django.db import models from django.db.models import lookups from django.utils.encoding import force_str @@ -18,12 +16,10 @@ from .validators import timezone_validator from .settings import INDEX_SEARCH_NAMES, CITIES_LIGHT_APP_NAME - __all__ = ['AbstractCountry', 'AbstractRegion', 'AbstractSubRegion', 'AbstractCity', 'CONTINENT_CHOICES'] - CONTINENT_CHOICES = ( ('OC', _('Oceania')), ('EU', _('Europe')), @@ -71,10 +67,11 @@ class ToSearchTextField(models.TextField): Trivial TextField subclass that passes values through to_search automatically. """ + + ToSearchTextField.register_lookup(ToSearchIContainsLookup) -@python_2_unicode_compatible class Base(models.Model): """ Base model with boilerplate for all models. diff --git a/cities_light/tests/test_unicode.py b/cities_light/tests/test_unicode.py index faed8668..7e3b8b7c 100644 --- a/cities_light/tests/test_unicode.py +++ b/cities_light/tests/test_unicode.py @@ -3,7 +3,6 @@ import warnings -import six import unidecode from django.utils.encoding import force_text @@ -66,5 +65,4 @@ def test_to_ascii(self): """Test to_ascii behavior.""" self.assertEqual(to_ascii('République Françaisen'), 'Republique Francaisen') self.assertEqual(to_ascii('Кемерово'), 'Kemerovo') - # Check that return value is unicode on python 2.7 or str on python 3 - self.assertTrue(isinstance(to_ascii('Кемерово'), six.text_type)) + self.assertTrue(isinstance(to_ascii('Кемерово'), str)) diff --git a/setup.py b/setup.py index 35251091..2f5a80b6 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def read(fname): setup( name='django-cities-light', - version='3.6.0', + version='3.7.0', description='Simple alternative to django-cities', author='James Pic,Dominick Rivard,Alexey Evseev', author_email='jamespic@gmail.com, dominick.rivard@gmail.com, myhappydo@gmail.com', @@ -27,11 +27,10 @@ def read(fname): license='MIT', keywords='django cities countries postal codes', install_requires=[ - 'six', 'pytz', 'unidecode>=0.04.13', - 'django-autoslug-iplweb>=1.9.4', - 'progressbar2>=3.6.0' + 'django-autoslug>=1.9.8', + 'progressbar2>=3.51.4' ], classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -41,7 +40,6 @@ def read(fname): 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Software Development :: Libraries :: Python Modules', diff --git a/tox.ini b/tox.ini index f1399973..459e7867 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{35,36, 37,38}-django{111,22,30}{-sqlite,-mysql,-postgresql}, + py{35,36, 37,38}-django{111,22,30,31}{-sqlite,-mysql,-postgresql}, py{35,36, 37,38}-djangodev{-sqlite,-mysql,-postgresql}, checkqa, docs @@ -42,7 +42,7 @@ deps = djangorestframework django-dbdiff>=0.4.0 django-ajax-selects==1.6.0 - django-autoslug-iplweb==1.9.4.dev0 + django-autoslug==1.9.8 [testenv] skipsdist = true @@ -58,7 +58,9 @@ deps = {[test]deps} django111: Django>=1.11a,<2.0 django20: Django>=2.0,<2.1 + django22: Django>=2.2,<3.0 django30: Django>=3.0,<3.1 + django31: Django>=3.1,<3.2 djangodev: https://github.com/django/django/archive/master.tar.gz postgresql: psycopg2 mysql: mysqlclient