Skip to content

Commit

Permalink
- Bump to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jan 15, 2020
1 parent 8d03339 commit 77b6580
Show file tree
Hide file tree
Showing 125 changed files with 910 additions and 540 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ scripts/spcgeonode/_volume_*
/geonode/test_settings.py

/geonode/static/yarn.lock

/geonode/development.db-journal

/output.bin
27 changes: 12 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sudo: required
language: python
dist: xenial
dist: bionic

cache:
pip: true
Expand Down Expand Up @@ -28,7 +28,7 @@ matrix:
fast_finish: true
include:
- name: "GeoServer-backend Core Modules Smoke Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -42,7 +42,7 @@ matrix:
MONITORING_ENABLED: 'False'
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- name: "GeoServer-backend Contrib Apps Smoke Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -56,7 +56,7 @@ matrix:
MONITORING_ENABLED: 'False'
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
- name: "GeoServer-backend Integration Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -78,7 +78,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration GeoServer Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -100,7 +100,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration Upload Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -122,7 +122,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration Monitoring Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -144,7 +144,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration CSW Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -159,7 +159,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "GeoServer-backend Integration BDD Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -176,7 +176,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Core Modules Smoke Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -195,7 +195,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Contrib Apps Smoke Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand All @@ -214,7 +214,7 @@ matrix:
SESSION_EXPIRED_CONTROL_ENABLED: 'True'
CELERY_ALWAYS_EAGER: 'True'
- name: "QGis Server-backend Integration Tests"
python: 2.7
python: 3.6
virtualenv:
system_site_packages: true
env:
Expand Down Expand Up @@ -245,9 +245,6 @@ matrix:
branches:
only:
- master
- 2.10.2
- 2.10.1
- 2.10.x

before_install:
- if [ "$TEST_RUN_SELENIUM" = "True" ]; then
Expand Down
6 changes: 3 additions & 3 deletions geonode/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from django.conf.urls import url
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from django.db.models import Count
Expand Down Expand Up @@ -374,7 +374,7 @@ def apply_filters(self, request, applicable_filters):
applicable_filters)

filtered = semi_filtered
if not user.is_authenticated() or user.is_anonymous:
if not user.is_authenticated or user.is_anonymous:
filtered = semi_filtered.exclude(groupprofile__access='private')
elif not user.is_superuser:
groups_member_of = user.group_list_all()
Expand Down Expand Up @@ -453,7 +453,7 @@ def apply_filters(self, request, applicable_filters):

def dehydrate_email(self, bundle):
email = ''
if bundle.request.user.is_authenticated():
if bundle.request.user.is_authenticated:
email = bundle.obj.email
return email

Expand Down
2 changes: 1 addition & 1 deletion geonode/api/resourcebase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import json
import re

from django.core.urlresolvers import resolve
from django.urls import resolve
from django.db.models import Q
from django.http import HttpResponse
from django.conf import settings
Expand Down
2 changes: 1 addition & 1 deletion geonode/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.conf import settings
from datetime import datetime, timedelta
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.urls import reverse
from tastypie.test import ResourceTestCaseMixin
from django.contrib.auth.models import Group
from geonode.decorators import on_ogc_backend
Expand Down
20 changes: 20 additions & 0 deletions geonode/base/migrations/0031_auto_20200114_1651.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-01-14 16:51
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('base', '0030_resourcebase_created'),
]

operations = [
migrations.AlterField(
model_name='resourcebase',
name='language',
field=models.CharField(choices=[('abk', 'Abkhazian'), ('aar', 'Afar'), ('afr', 'Afrikaans'), ('amh', 'Amharic'), ('ara', 'Arabic'), ('asm', 'Assamese'), ('aym', 'Aymara'), ('aze', 'Azerbaijani'), ('bak', 'Bashkir'), ('ben', 'Bengali'), ('bih', 'Bihari'), ('bis', 'Bislama'), ('bre', 'Breton'), ('bul', 'Bulgarian'), ('bel', 'Byelorussian'), ('cat', 'Catalan'), ('chi', 'Chinese'), ('cos', 'Corsican'), ('dan', 'Danish'), ('dzo', 'Dzongkha'), ('eng', 'English'), ('fra', 'French'), ('epo', 'Esperanto'), ('est', 'Estonian'), ('fao', 'Faroese'), ('fij', 'Fijian'), ('fin', 'Finnish'), ('fry', 'Frisian'), ('glg', 'Gallegan'), ('ger', 'German'), ('gre', 'Greek'), ('kal', 'Greenlandic'), ('grn', 'Guarani'), ('guj', 'Gujarati'), ('hau', 'Hausa'), ('heb', 'Hebrew'), ('hin', 'Hindi'), ('hun', 'Hungarian'), ('ind', 'Indonesian'), ('ina', 'Interlingua (International Auxiliary language Association)'), ('iku', 'Inuktitut'), ('ipk', 'Inupiak'), ('ita', 'Italian'), ('jpn', 'Japanese'), ('kan', 'Kannada'), ('kas', 'Kashmiri'), ('kaz', 'Kazakh'), ('khm', 'Khmer'), ('kin', 'Kinyarwanda'), ('kir', 'Kirghiz'), ('kor', 'Korean'), ('kur', 'Kurdish'), ('oci', "Langue d 'Oc (post 1500)"), ('lao', 'Lao'), ('lat', 'Latin'), ('lav', 'Latvian'), ('lin', 'Lingala'), ('lit', 'Lithuanian'), ('mlg', 'Malagasy'), ('mlt', 'Maltese'), ('mar', 'Marathi'), ('mol', 'Moldavian'), ('mon', 'Mongolian'), ('nau', 'Nauru'), ('nep', 'Nepali'), ('nor', 'Norwegian'), ('ori', 'Oriya'), ('orm', 'Oromo'), ('pan', 'Panjabi'), ('pol', 'Polish'), ('por', 'Portuguese'), ('pus', 'Pushto'), ('que', 'Quechua'), ('roh', 'Rhaeto-Romance'), ('run', 'Rundi'), ('rus', 'Russian'), ('smo', 'Samoan'), ('sag', 'Sango'), ('san', 'Sanskrit'), ('scr', 'Serbo-Croatian'), ('sna', 'Shona'), ('snd', 'Sindhi'), ('sin', 'Singhalese'), ('ssw', 'Siswant'), ('slv', 'Slovenian'), ('som', 'Somali'), ('sot', 'Sotho'), ('spa', 'Spanish'), ('sun', 'Sudanese'), ('swa', 'Swahili'), ('tgl', 'Tagalog'), ('tgk', 'Tajik'), ('tam', 'Tamil'), ('tat', 'Tatar'), ('tel', 'Telugu'), ('tha', 'Thai'), ('tir', 'Tigrinya'), ('tog', 'Tonga (Nyasa)'), ('tso', 'Tsonga'), ('tsn', 'Tswana'), ('tur', 'Turkish'), ('tuk', 'Turkmen'), ('twi', 'Twi'), ('uig', 'Uighur'), ('ukr', 'Ukrainian'), ('urd', 'Urdu'), ('uzb', 'Uzbek'), ('vie', 'Vietnamese'), ('vol', 'Volapük'), ('wol', 'Wolof'), ('xho', 'Xhosa'), ('yid', 'Yiddish'), ('yor', 'Yoruba'), ('zha', 'Zhuang'), ('zul', 'Zulu')], default='eng', help_text='language used within the dataset', max_length=3, verbose_name='language'),
),
]
34 changes: 34 additions & 0 deletions geonode/base/migrations/0032_auto_20200115_1121.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 2.2.9 on 2020-01-15 11:21

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('base', '0031_auto_20200114_1651'),
]

operations = [
migrations.AlterField(
model_name='curatedthumbnail',
name='resource',
field=models.OneToOneField(on_delete='CASCASE', to='base.ResourceBase'),
),
migrations.AlterField(
model_name='resourcebase',
name='category',
field=models.ForeignKey(blank=True, help_text='high-level geographic data thematic classification to assist in the grouping and search of available geographic data sets.', limit_choices_to=models.Q(is_choice=True), null=True, on_delete=django.db.models.deletion.CASCADE, to='base.TopicCategory'),
),
migrations.AlterField(
model_name='resourcebase',
name='restriction_code_type',
field=models.ForeignKey(blank=True, help_text='limitation(s) placed upon the access or use of the data.', limit_choices_to=models.Q(is_choice=True), null=True, on_delete=django.db.models.deletion.CASCADE, to='base.RestrictionCodeType', verbose_name='restrictions'),
),
migrations.AlterField(
model_name='resourcebase',
name='spatial_representation_type',
field=models.ForeignKey(blank=True, help_text='method used to represent geographic information in the dataset.', limit_choices_to=models.Q(is_choice=True), null=True, on_delete=django.db.models.deletion.CASCADE, to='base.SpatialRepresentationType', verbose_name='spatial representation type'),
),
]
17 changes: 17 additions & 0 deletions geonode/base/migrations/0033_auto_20200115_1145.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.9 on 2020-01-15 11:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('base', '0032_auto_20200115_1121'),
]

operations = [
migrations.AlterModelOptions(
name='resourcebase',
options={'permissions': (('change_resourcebase_permissions', 'Can change resource permissions'), ('download_resourcebase', 'Can download resource'), ('publish_resourcebase', 'Can publish resource'), ('change_resourcebase_metadata', 'Can change resource metadata'))},
),
]
27 changes: 17 additions & 10 deletions geonode/base/migrations/24_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('role', models.CharField(help_text='function performed by the responsible party', max_length=255, choices=[('author', 'party who authored the resource'), ('processor', 'party who has processed the data in a manner such that the resource has been modified'), ('publisher', 'party who published the resource'), ('custodian', 'party that accepts accountability and responsibility for the data and ensures appropriate care and maintenance of the resource'), ('pointOfContact', 'party who can be contacted for acquiring knowledge about or acquisition of the resource'), ('distributor', 'party who distributes the resource'), ('user', 'party who uses the resource'), ('resourceProvider', 'party that supplies the resource'), ('originator', 'party who created the resource'), ('owner', 'party that owns the resource'), ('principalInvestigator', 'key party responsible for gathering information and conducting research')])),
('contact', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('contact', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
Expand Down Expand Up @@ -67,7 +67,8 @@ class Migration(migrations.Migration):
('rght', models.PositiveIntegerField(editable=False, db_index=True)),
('tree_id', models.PositiveIntegerField(editable=False, db_index=True)),
('level', models.PositiveIntegerField(editable=False, db_index=True)),
('parent', mptt.fields.TreeForeignKey(related_name='children', blank=True, to='base.Region', null=True)),
('parent', mptt.fields.TreeForeignKey(related_name='children',
on_delete=models.CASCADE, blank=True, to='base.Region', null=True)),
],
options={
'ordering': ('name',),
Expand Down Expand Up @@ -170,7 +171,8 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='resourcebase',
name='category',
field=models.ForeignKey(blank=True, to='base.TopicCategory', help_text='high-level geographic data thematic classification to assist in the grouping and search of available geographic data sets.', null=True),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.TopicCategory',
help_text='high-level geographic data thematic classification to assist in the grouping and search of available geographic data sets.', null=True),
),
migrations.AddField(
model_name='resourcebase',
Expand All @@ -180,17 +182,20 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='resourcebase',
name='license',
field=models.ForeignKey(blank=True, to='base.License', help_text='license of the dataset', null=True, verbose_name='License'),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.License',
help_text='license of the dataset', null=True, verbose_name='License'),
),
migrations.AddField(
model_name='resourcebase',
name='owner',
field=models.ForeignKey(related_name='owned_resource', verbose_name='Owner', blank=True, to=settings.AUTH_USER_MODEL, null=True),
field=models.ForeignKey(related_name='owned_resource', on_delete=models.CASCADE,
verbose_name='Owner', blank=True, to=settings.AUTH_USER_MODEL, null=True),
),
migrations.AddField(
model_name='resourcebase',
name='polymorphic_ctype',
field=models.ForeignKey(related_name='polymorphic_base.resourcebase_set+', editable=False, to='contenttypes.ContentType', null=True),
field=models.ForeignKey(related_name='polymorphic_base.resourcebase_set+',
on_delete=models.CASCADE, editable=False, to='contenttypes.ContentType', null=True),
),
migrations.AddField(
model_name='resourcebase',
Expand All @@ -200,22 +205,24 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='resourcebase',
name='restriction_code_type',
field=models.ForeignKey(blank=True, to='base.RestrictionCodeType', help_text='limitation(s) placed upon the access or use of the data.', null=True, verbose_name='restrictions'),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.RestrictionCodeType',
help_text='limitation(s) placed upon the access or use of the data.', null=True, verbose_name='restrictions'),
),
migrations.AddField(
model_name='resourcebase',
name='spatial_representation_type',
field=models.ForeignKey(blank=True, to='base.SpatialRepresentationType', help_text='method used to represent geographic information in the dataset.', null=True, verbose_name='spatial representation type'),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.SpatialRepresentationType',
help_text='method used to represent geographic information in the dataset.', null=True, verbose_name='spatial representation type'),
),
migrations.AddField(
model_name='link',
name='resource',
field=models.ForeignKey(blank=True, to='base.ResourceBase', null=True),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.ResourceBase', null=True),
),
migrations.AddField(
model_name='contactrole',
name='resource',
field=models.ForeignKey(blank=True, to='base.ResourceBase', null=True),
field=models.ForeignKey(blank=True, on_delete=models.CASCADE, to='base.ResourceBase', null=True),
),
migrations.AlterUniqueTogether(
name='contactrole',
Expand Down
8 changes: 4 additions & 4 deletions geonode/base/migrations/24_to_26.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class Migration(migrations.Migration):
name='TaggedContentItem',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('content_object', models.ForeignKey(to='base.ResourceBase')),
('tag', models.ForeignKey(related_name='keywords', to='base.HierarchicalKeyword')),
('content_object', models.ForeignKey(to='base.ResourceBase', on_delete=models.CASCADE)),
('tag', models.ForeignKey(related_name='keywords', to='base.HierarchicalKeyword', on_delete=models.CASCADE)),
],
options={
'abstract': False,
Expand All @@ -76,7 +76,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('about', models.CharField(max_length=255, null=True, blank=True)),
('alt_label', models.CharField(default='', max_length=255, null=True, blank=True)),
('thesaurus', models.ForeignKey(related_name='thesaurus', to='base.Thesaurus')),
('thesaurus', models.ForeignKey(related_name='thesaurus', to='base.Thesaurus', on_delete=models.CASCADE)),
],
options={
'ordering': ('alt_label',),
Expand All @@ -89,7 +89,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('lang', models.CharField(max_length=3)),
('label', models.CharField(max_length=255)),
('keyword', models.ForeignKey(related_name='keyword', to='base.ThesaurusKeyword')),
('keyword', models.ForeignKey(related_name='keyword', to='base.ThesaurusKeyword', on_delete=models.CASCADE)),
],
options={
'ordering': ('keyword', 'lang'),
Expand Down
2 changes: 1 addition & 1 deletion geonode/base/migrations/26_to_27.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='resourcebase',
name='group',
field=models.ForeignKey(blank=True, to='auth.Group', null=True),
field=models.ForeignKey(blank=True, to='auth.Group', null=True, on_delete=models.CASCADE),
),

migrations.AddField(
Expand Down
Loading

0 comments on commit 77b6580

Please sign in to comment.