From 6b569f40a020a4af6678922f29b11f743fda7fa5 Mon Sep 17 00:00:00 2001 From: blag Date: Sat, 23 Feb 2019 23:49:30 -0800 Subject: [PATCH 1/9] Update Travis test matrix and supported compatibility table --- .travis.yml | 33 ++++++++++++++++----------------- README.md | 32 +++++++++++++++++--------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 86d205d3..641c6112 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,46 +11,45 @@ addons: 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: "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' + - python: "3.4" + env: DJANGO_VERSION='Django>=2.1,<2.2' - env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' install: diff --git a/README.md b/README.md index b38de1ef..fa2cddfb 100644 --- a/README.md +++ b/README.md @@ -12,22 +12,24 @@ 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 | +| 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: | :large_blue_circle: | :white_check_mark: | :white_check_mark: | :white_check_mark: | + + + +| 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 | +| :x: | Known incompatibilities | Authored by [Ben Dowling](http://www.coderholic.com), and some great [contributors](https://github.com/coderholic/django-cities/contributors). From 1b48090ba28d3038d79e589af627925c1a15cd4e Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 00:06:25 -0800 Subject: [PATCH 2/9] A few lint fixes --- cities/management/commands/cities.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cities/management/commands/cities.py b/cities/management/commands/cities.py index d50a4a54..f4c85d13 100644 --- a/cities/management/commands/cities.py +++ b/cities/management/commands/cities.py @@ -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( @@ -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 @@ -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)) From 14f279ff7d36c1686e3589ccaba3735533863d83 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 00:27:55 -0800 Subject: [PATCH 3/9] Add flake8 options to setup.cfg and tweak travis configuration --- .travis.yml | 2 +- setup.cfg | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 setup.cfg diff --git a/.travis.yml b/.travis.yml index 641c6112..451d69ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,5 +62,5 @@ before_script: - 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 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..7843919b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[flake8] +ignore = W503,E501 +exclude = build,dist From c41bb4f130e0d70c06f55e9d34f8fe19d091e02f Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 00:35:48 -0800 Subject: [PATCH 4/9] Ignore W504, not W503 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7843919b..34bde0f8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,3 @@ [flake8] -ignore = W503,E501 +ignore = W504,E501 exclude = build,dist From 75d59bae217af480e906e53fb5ef61080c5d8663 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 00:49:53 -0800 Subject: [PATCH 5/9] Use Ubuntu Xenial to run tests --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 451d69ed..3d199cc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +# We need to use Ubuntu 16.04 (Xenial Xerus) to get Python 3.7 +dist: xenial + language: python services: From 9ce15d6c57e97c22fc205bfe0fd369b48a0e6ec7 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 01:22:21 -0800 Subject: [PATCH 6/9] Workaround PostGIS on Ubuntu Xenial on Travis issue --- .travis.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d199cc1..998acd22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,10 @@ services: 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" @@ -55,6 +56,10 @@ matrix: env: DJANGO_VERSION='Django>=2.1,<2.2' - env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' +before_install: + # https://gis.stackexchange.com/a/252610 + - sudo apt-get install --yes postgresql-9.6-postgis-2.3 + install: - pip install -q $DJANGO_VERSION - pip install -q django-model-utils flake8 psycopg2 six swapper tox tqdm From fb26797bfacb6787a478f2b8f344c852cd844c13 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 01:41:31 -0800 Subject: [PATCH 7/9] Maybe this will work? --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 998acd22..14bf846c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,14 +58,16 @@ matrix: before_install: # https://gis.stackexchange.com/a/252610 - - sudo apt-get install --yes postgresql-9.6-postgis-2.3 + - 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 From 182fd55b5e35681872a68916e78821b46bb4a0f5 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 02:47:00 -0800 Subject: [PATCH 8/9] Don't even try to run Django 2.1 on Python 3.4 --- .travis.yml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14bf846c..c245a73f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,8 @@ matrix: env: DJANGO_VERSION='Django>=2.0,<2.1' - python: "2.7" 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" @@ -52,8 +54,6 @@ matrix: env: DJANGO_VERSION='Django>=1.10,<1.11' - python: "3.7" env: DJANGO_VERSION='Django>=1.10,<1.11' - - python: "3.4" - env: DJANGO_VERSION='Django>=2.1,<2.2' - env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' before_install: diff --git a/README.md b/README.md index fa2cddfb..a6dff853 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This package officially supports all currently supported versions of Python/Djan | 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: | :large_blue_circle: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Django 2.1 | :x: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | From 98dcef6a717c3d8f71573e2d69a311b2db4472d7 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 24 Feb 2019 02:50:28 -0800 Subject: [PATCH 9/9] Removed unused key from compatibility table --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index a6dff853..ff34dc46 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ This package officially supports all currently supported versions of Python/Djan | :-------------------: | :------------------------------------------------------------------ | | :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 | Authored by [Ben Dowling](http://www.coderholic.com), and some great [contributors](https://github.com/coderholic/django-cities/contributors).