update to python3.7, update dependencies and fix obvious update issues

This commit is contained in:
Laura Klünder 2018-09-16 20:08:01 +02:00
parent 2946de94f6
commit c5fc590c2a
16 changed files with 52 additions and 46 deletions

View file

@ -1,8 +1,8 @@
import re
from collections import OrderedDict
from compressor.utils.decorators import cached_property
from django.conf.urls import include, url
from django.utils.functional import cached_property
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from rest_framework.routers import SimpleRouter

View file

@ -38,19 +38,21 @@ class ChangeSet(models.Model):
)
created = models.DateTimeField(auto_now_add=True, verbose_name=_('created'))
last_change = models.ForeignKey('editor.ChangeSetUpdate', null=True, related_name='+',
verbose_name=_('last object change'))
verbose_name=_('last object change'), on_delete=models.PROTECT)
last_update = models.ForeignKey('editor.ChangeSetUpdate', null=True, related_name='+',
verbose_name=_('last update'))
verbose_name=_('last update'), on_delete=models.PROTECT)
last_state_update = models.ForeignKey('editor.ChangeSetUpdate', null=True, related_name='+',
verbose_name=_('last state update'))
verbose_name=_('last state update'), on_delete=models.PROTECT)
state = models.CharField(max_length=20, db_index=True, choices=STATES, default='unproposed')
author = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.PROTECT, verbose_name=_('Author'))
title = models.CharField(max_length=100, default='', verbose_name=_('Title'))
description = models.TextField(max_length=1000, default='', verbose_name=_('Description'))
assigned_to = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, on_delete=models.PROTECT,
related_name='assigned_changesets', verbose_name=_('assigned to'))
map_update = models.OneToOneField(MapUpdate, null=True, related_name='changeset', verbose_name=_('map update'))
last_cleaned_with = models.ForeignKey(MapUpdate, null=True, related_name='checked_changesets')
map_update = models.OneToOneField(MapUpdate, null=True, related_name='changeset',
verbose_name=_('map update'), on_delete=models.PROTECT)
last_cleaned_with = models.ForeignKey(MapUpdate, null=True, related_name='checked_changesets',
on_delete=models.PROTECT)
class Meta:
verbose_name = _('Change Set')

View file

@ -9,8 +9,8 @@ from django.http import Http404
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import NoReverseMatch, reverse
from django.utils.text import format_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language_info
from django.utils.translation import ugettext_lazy as _
from c3nav.editor.forms import ChangeSetForm, RejectForm
from c3nav.editor.models import ChangeSet

View file

@ -10,8 +10,8 @@ from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.cache import get_conditional_response
from django.utils.http import http_date, quote_etag, urlsafe_base64_encode
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from rest_framework.decorators import detail_route, list_route
from rest_framework.exceptions import NotFound, ValidationError
from rest_framework.mixins import RetrieveModelMixin

View file

@ -8,8 +8,8 @@ from django.core.validators import RegexValidator
from django.db import models
from django.utils.functional import cached_property, lazy
from django.utils.text import format_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language
from django.utils.translation import ugettext_lazy as _
from shapely import validation
from shapely.geometry import LineString, MultiPolygon, Point, Polygon, mapping, shape
from shapely.geometry.base import BaseGeometry

View file

@ -4,8 +4,8 @@ from django.conf import settings
from django.core.exceptions import ValidationError
from django.forms import CharField, ModelForm
from django.utils.text import capfirst, format_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language_info
from django.utils.translation import ugettext_lazy as _
from c3nav.mapdata.fields import I18nField

View file

@ -240,7 +240,7 @@ class AccessPermission(models.Model):
class AccessRestrictionMixin(SerializableMixin, models.Model):
access_restriction = models.ForeignKey(AccessRestriction, null=True, blank=True,
verbose_name=_('Access Restriction'))
verbose_name=_('Access Restriction'), on_delete=models.PROTECT)
class Meta:
abstract = True

View file

@ -3,8 +3,8 @@ from collections import OrderedDict
from django.core.cache import cache
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language, get_language_info
from django.utils.translation import ugettext_lazy as _
from c3nav.mapdata.fields import I18nField
from c3nav.mapdata.models import MapUpdate

View file

@ -5,7 +5,7 @@ from itertools import chain
from queue import Queue
from typing import Optional
import ModernGL
import moderngl
import numpy as np
from PIL import Image
from shapely.geometry import CAP_STYLE, JOIN_STYLE, Polygon
@ -25,14 +25,14 @@ class RenderContext(namedtuple('RenderContext', ('width', 'height', 'ctx', 'prog
@classmethod
def create(cls, width, height):
ctx = ModernGL.create_standalone_context()
ctx = moderngl.create_standalone_context()
color_rbo = ctx.renderbuffer((width, height), samples=ctx.max_samples)
fbo = ctx.framebuffer([color_rbo])
fbo.use()
prog = ctx.program([
ctx.vertex_shader('''
prog = ctx.program(
vertex_shader='''
#version 330
in vec3 in_vert;
in vec4 in_color;
@ -44,18 +44,18 @@ class RenderContext(namedtuple('RenderContext', ('width', 'height', 'ctx', 'prog
gl_Position = mvp * vec4(in_vert, 1.0);
v_color = in_color;
}
'''),
ctx.fragment_shader('''
''',
fragment_shader='''
#version 330
in vec4 v_color;
out vec4 f_color;
void main() {
f_color = v_color;
}
'''),
])
'''
)
ctx.enable(ModernGL.BLEND)
ctx.enable(moderngl.BLEND)
return cls(width, height, ctx, prog, fbo)
@ -115,15 +115,16 @@ class OpenGLWorker(threading.Thread):
ctx = self._get_ctx(task.width, task.height)
ctx.ctx.clear(*task.background_rgb)
ctx.prog.uniforms['mvp'].value = task.mvp
ctx.prog['mvp'].value = task.mvp
if task.vertices:
vbo = ctx.ctx.buffer(task.vertices)
vao = ctx.ctx.simple_vertex_array(ctx.prog, vbo, ['in_vert', 'in_color'])
# noinspection PyTypeChecker
vao = ctx.ctx.simple_vertex_array(ctx.prog, vbo, 'in_vert', 'in_color')
vao.render()
color_rbo2 = ctx.ctx.renderbuffer((task.width, task.height))
fbo2 = ctx.ctx.framebuffer(color_rbo2)
fbo2 = ctx.ctx.framebuffer([color_rbo2])
ctx.ctx.copy_framebuffer(fbo2, ctx.fbo)
img = Image.frombytes('RGB', (task.width, task.height), fbo2.read(components=3))

View file

@ -12,7 +12,7 @@ import c3nav.site.urls
urlpatterns = [
url(r'^editor/', include(c3nav.editor.urls)),
url(r'^api/', include(c3nav.api.urls, namespace='api')),
url(r'^api/', include((c3nav.api.urls, 'api'), namespace='api')),
url(r'^map/', include(c3nav.mapdata.urls)),
url(r'^admin/', admin.site.urls),
url(r'^control/', include(c3nav.control.urls)),

View file

@ -1,3 +1,3 @@
requests>=2.17,<2.18
numpy>=1.13,<1.14
requests>=2.19,<2.20
numpy>=1.15,<1.16
pylibmc>=1.5,<1.6

View file

@ -1 +1 @@
ModernGL>=4.2,<4.3
ModernGL>=5.4,<5.5

View file

@ -1,16 +1,16 @@
Django>=1.11,<1.12
django-bootstrap3>=8.2,<8.3
django-compressor==2.1
Django>=2.1,<2.2
django-bootstrap3>=11.0,<11.1
django-compressor==2.2
csscompressor
djangorestframework>=3.6,<3.7
django-filter>=1.0,<1.1
shapely>=1.5,<1.6
MeshPy>=2016.1,<2016.2
djangorestframework>=3.8,<3.9
django-filter>=2.0,<2.1
shapely>=1.6,<1.7
-e git://github.com/c3nav/meshpy#egg=MeshPy
rtree>=0.8,<0.9
celery>=4.0,<4.1
requests>=2.17,<2.18
Pillow>=4.1,<4.2
qrcode>=5.3,<5.4
matplotlib>=2.0,<2.1
scipy>=0.19,<0.20
celery>=4.2,<4.3
requests>=2.19,<2.20
Pillow>=5.2,<5.3
qrcode>=6.0,<6.1
matplotlib>=2.2,<2.3
scipy>=1.1,<1.2
django_libsass>=0.7,<0.8

View file

@ -1,2 +1,2 @@
django-redis>=4.8,<4.9
django-redis>=4.9,<4.10
redis>=2.10,<2.11

View file

@ -1,2 +1,2 @@
pgi==0.0.11.1
cairocffi>=0.8,<0.9
pgi==0.0.11.2
cairocffi>=0.9,<0.10