Skip to content

Commit

Permalink
Merge pull request #60 from observatorycontrolsystem/fix/upgrade-vers…
Browse files Browse the repository at this point in the history
…ions

Upgrade to Django 4
  • Loading branch information
jnation3406 authored Feb 1, 2024
2 parents 7d0476e + bf8141b commit 75a6380
Show file tree
Hide file tree
Showing 11 changed files with 616 additions and 662 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
python-version: ["3.8", "3.9", "3.10"]
services:
postgres:
image: postgis/postgis:9.6-2.5
image: postgis/postgis:14-3.3
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: archive
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.4.0
2024-01-31

Update to django 4 and related dependency updates.

2.3.7
2024-01-03

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim AS app
FROM python:3.10-slim AS app

# Set working directory
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions archive/authentication/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.conf.urls import url
from django.urls import re_path
from archive.authentication import views

urlpatterns = [
url(r'^profile/$', views.UserView.as_view(), name='profile'),
re_path(r'^profile/$', views.UserView.as_view(), name='profile'),
]
2 changes: 0 additions & 2 deletions archive/frames/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.contrib import admin
from archive.frames.models import Frame, Version, Headers
from archive.frames.forms import FrameForm
from archive.frames.pagination import LimitedLimitOffsetPagination

class VersionInlineAdmin(admin.StackedInline):
model = Version
Expand All @@ -19,6 +18,5 @@ class FrameAdmin(admin.ModelAdmin):
VersionInlineAdmin
]
form = FrameForm
paginator = LimitedLimitOffsetPagination

admin.site.register(Frame, FrameAdmin)
3 changes: 1 addition & 2 deletions archive/frames/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from archive.frames.utils import get_file_store_path
from django.utils.functional import cached_property
from django.contrib.postgres.fields import JSONField
import hashlib
from django.db.models import JSONField
import logging
import json
from django.contrib.gis.db import models
Expand Down
7 changes: 3 additions & 4 deletions archive/frames/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from django.conf.urls import url
from django.urls import include
from django.urls import re_path, include
from rest_framework.routers import DefaultRouter
from archive.frames import views

Expand All @@ -13,6 +12,6 @@
router.register(r'frame-catalog', views.CatalogViewSet, basename='frame-catalog')

urlpatterns = [
url(r'^', include(router.urls)),
url(r'^authprofile/', include(authprofile_urls))
re_path(r'^', include(router.urls)),
re_path(r'^authprofile/', include(authprofile_urls))
]
1 change: 0 additions & 1 deletion archive/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'ocs_authentication.auth_profile',
'django_filters',
'corsheaders',
'crispy_forms',
'django_extensions',
'archive.frames',
'archive.authentication',
Expand Down
19 changes: 9 additions & 10 deletions archive/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.conf.urls import url, include
from django.urls import re_path, path, include
from django.contrib import admin
from django.urls import path
from django.http import HttpResponse
from django.conf import settings
from drf_yasg.views import get_schema_view
Expand All @@ -27,14 +26,14 @@
generator_class=ScienceArchiveSchemaGenerator)

urlpatterns = [
url(r'^robots.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", content_type='text/plain')),
url(r'^', include(frame_urls)),
url(r'^', include(auth_urls)),
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^api-token-auth/', ObtainAuthTokenWithHeaders.as_view()),
url(r'^revoke_token/', RevokeApiTokenApiView.as_view(), name='revoke_api_token'),
url(r'^health/', HealthCheckView.as_view()),
re_path(r'^robots.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", content_type='text/plain')),
re_path(r'^', include(frame_urls)),
re_path(r'^', include(auth_urls)),
re_path(r'^admin/', admin.site.urls),
re_path(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
re_path(r'^api-token-auth/', ObtainAuthTokenWithHeaders.as_view()),
re_path(r'^revoke_token/', RevokeApiTokenApiView.as_view(), name='revoke_api_token'),
re_path(r'^health/', HealthCheckView.as_view()),
path('openapi/', schema_view.as_view(), name='openapi-schema'),
path('redoc/', TemplateView.as_view(
template_name='redoc.html',
Expand Down
1,209 changes: 582 additions & 627 deletions poetry.lock

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
[tool.poetry]
name = "science-archive"
version = "2.3.7"
version = "2.4.0"
description = ""
authors = ["Jashandeep Sohi <[email protected]>"]
readme = "README.md"
packages = [{include = "archive"}]

[tool.poetry.dependencies]
python = "^3.8"
django = "^3.2"
django = "^4"
psycopg2 = "~2.9"
django-filter = ">=2.2,<2.5"
djangorestframework = ">=3.12,<3.13"
PyYAML = ">=5.4"
boto3 = "~1.24"
django-filter = "^21.1"
djangorestframework = "^3.13"
PyYAML = "^6.0"
boto3 = "<2.0"
astropy = "~5.1.0"
django-crispy-forms = ">=1.14,<2"
Markdown = ">=3.0,<3.1"
gunicorn = {version = "20.1.0", extras = ["gevent"]}
django-cors-headers = ">=3.4,<4.0"
drf-yasg = ">=1.20,<1.21"
django-cors-headers = ">=3.11,<4.0"
drf-yasg = "^1.21"
python3-memcached = ">=1.51,<2.0"
uritemplate = "3.0.1"
kombu = ">=4.6,<4.7"
ocs-authentication = "0.1.0"
ocs-authentication = "0.2.2"
setuptools-scm = "6.0.1"
requests = ">2.0,<3.0"
django-extensions = "^3.2.1"
lcogt-logging = "^0.3.2"
pytz = "^2022.2.1"
django-redis = "^5.2.0"
ocs-archive = "0.2.9"

ocs-archive = "0.3.0"
urllib3 = "<2.0"

[tool.poetry.group.dev.dependencies]
flake8 = "^5.0.4"
Expand Down

0 comments on commit 75a6380

Please sign in to comment.