Skip to content

Commit

Permalink
New version 3.7.0 (#226)
Browse files Browse the repository at this point in the history
* Removed six and python 2 compatible code
* Updated CHANGELOG and README
* Support for Django 3.1
* Travis Django 3.1
* Added my self to author
  • Loading branch information
marianoeramirez authored Aug 7, 2020
1 parent 29d3bf7 commit 47ece31
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
- Charles Sartori @csarcom
- Aaron VanDerlip @aaronvanderlip
- Chris Vigelius @chrisv2
- Mariano Ramirez @marianoeramirez
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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::

Expand Down
7 changes: 2 additions & 5 deletions cities_light/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')),
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions cities_light/tests/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import warnings

import six
import unidecode

from django.utils.encoding import force_text
Expand Down Expand Up @@ -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))
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected], [email protected], [email protected]',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 47ece31

Please sign in to comment.