Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 31 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,76 @@
# We need to use Ubuntu 16.04 (Xenial Xerus) to get Python 3.7
dist: xenial

language: python

services:
- postgresql

addons:
postgresql: "9.6"
apt:
packages:
- postgresql-9.6-postgis-2.3
# https://gis.stackexchange.com/a/252610
# apt:
# packages:
# - postgresql-9.6-postgis-2.3

python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"

env:
- DJANGO_VERSION='Django>=1.7,<1.8'
- DJANGO_VERSION='Django>=1.8,<1.9'
- DJANGO_VERSION='Django>=1.9,<1.10'
- DJANGO_VERSION='Django>=1.10,<1.11'
- DJANGO_VERSION='Django>=1.11,<2.0'
- DJANGO_VERSION='Django>=2.0,<2.1'
- DJANGO_VERSION='Django>=2.1,<2.2'
- DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'

matrix:
exclude:
- python: "3.5"
env: DJANGO_VERSION='Django>=1.7,<1.8'
- python: "3.6"
env: DJANGO_VERSION='Django>=1.7,<1.8'
- python: "3.3"
env: DJANGO_VERSION='Django>=1.9,<1.10'
- python: "3.3"
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "3.3"
env: DJANGO_VERSION='Django>=1.11,<2.0'
- python: "2.7"
env: DJANGO_VERSION='Django>=2.0,<2.1'
- python: "3.3"
env: DJANGO_VERSION='Django>=2.0,<2.1'
- python: "2.7"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.3"
env: DJANGO_VERSION='Django>=2.1,<2.2'
- python: "3.4"
env: DJANGO_VERSION='Django>=2.1,<2.2'
- python: "2.7"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
- python: "3.4"
env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'
allow_failures:
- env: DJANGO_VERSION='Django>=1.7,<1.8'
- python: "3.6"
env: DJANGO_VERSION='Django>=1.8,<1.9'
- python: "3.7"
env: DJANGO_VERSION='Django>=1.8,<1.9'
- python: "3.6"
env: DJANGO_VERSION='Django>=1.9,<1.10'
- python: "3.7"
env: DJANGO_VERSION='Django>=1.9,<1.10'
- python: "3.6"
env: DJANGO_VERSION='Django>=1.10,<1.11'
- python: "3.7"
env: DJANGO_VERSION='Django>=1.10,<1.11'
- env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz'

before_install:
# https://gis.stackexchange.com/a/252610
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
- sudo apt-get install --yes postgresql-9.6-postgis-2.4

install:
- pip install -q $DJANGO_VERSION
- pip install -q django-model-utils flake8 psycopg2 six swapper tox tqdm

before_script:
- psql -U postgres -c "CREATE EXTENSION postgis;"
# - psql -U postgres -c "CREATE EXTENSION postgis;"
- psql -c 'create database django_cities;' -U postgres
- psql -U postgres -c 'CREATE EXTENSION postgis;' -d django_cities

script:
- flake8 --ignore=E501
- flake8
- PYTHONPATH=. python test_project/manage.py test test_app --noinput
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ django-cities provides you with place related models (eg. Country, Region, City)

This package officially supports all currently supported versions of Python/Django:

| Python | 2.7 | 3.3 | 3.4 | 3.5 | 3.6 |
| :------------ | --- | --- | --- | --- | --- |
| Django 1.7 | :x: | :x: | :x: | :x: | :x: |
| Django 1.8 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :large_blue_circle: |
| Django 1.9 | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :large_blue_circle: |
| Django 1.10 | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :large_blue_circle: |
| Django 1.11 | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Django 2.0 | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Django [master](https://github.com/django/django/archive/master.tar.gz) | :x: | :x: | :x: | :x: | :x: |

| Key | |
| :-: | :------------------------------------------------------------------ |
| :white_check_mark: | Officially supported, tested, and passing |
| :large_blue_circle: | Tested and passing, but not officially supported |
| :white_square_button: | Not officially supported, may break at any time, most tests passing |
| :x: | Known incompatibilities |
| Python | 2.7 | 3.4 | 3.5 | 3.6 | 3.7 |
| :------------ | ------------------ | ------------------- | ------------------ | ------------------- | --------------------- |
| Django 1.7 | :x: | :x: | :x: | :x: | :x: |
| Django 1.8 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :large_blue_circle: | :large_blue_circle: |
| Django 1.9 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :large_blue_circle: | :large_blue_circle: |
| Django 1.10 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :large_blue_circle: | :large_blue_circle: |
| Django 1.11 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Django 2.0 | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Django 2.1 | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
<!-- | Django [master](https://github.com/django/django/archive/master.tar.gz) | :x: | :x: | :x: | :x: | :x: | -->
<!-- 2.7 3.4 3.5 3.6 3.7 -->

| Key | |
| :-------------------: | :------------------------------------------------------------------ |
| :white_check_mark: | Officially supported, tested, and passing |
| :large_blue_circle: | Tested and passing, but not officially supported |
| :x: | Known incompatibilities |

Authored by [Ben Dowling](http://www.coderholic.com), and some great [contributors](https://github.com/coderholic/django-cities/contributors).

Expand Down
8 changes: 4 additions & 4 deletions cities/management/commands/cities.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def add_arguments(self, parser):
metavar="DATA_TYPES",
default='all',
dest="import",
help='Selectively import data. Comma separated list of data ' +
help='Selectively import data. Comma separated list of data '
'types: ' + str(import_opts).replace("'", '')
)
parser.add_argument(
Expand Down Expand Up @@ -752,7 +752,7 @@ def import_alt_name(self):
geo_info['type'].__name__,
item['name']))
continue
alt.is_historic = True if ((item['isHistoric']and
alt.is_historic = True if ((item['isHistoric'] and
item['isHistoric'] != '\n') or
locale == 'fr_1793') else False

Expand Down Expand Up @@ -789,8 +789,8 @@ def import_alt_name(self):
continue

if hasattr(alt, 'kind'):
if (locale in ('abbr', 'link', 'name') or
INCLUDE_AIRPORT_CODES and locale in ('iana', 'icao', 'faac')):
if locale in ('abbr', 'link', 'name') or \
INCLUDE_AIRPORT_CODES and locale in ('iana', 'icao', 'faac'):
alt.kind = locale
elif locale not in settings.locales and 'all' not in settings.locales:
self.logger.debug("Unknown alternative name type: {} -- skipping".format(locale))
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = W504,E501
exclude = build,dist