Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: BEG-7: Django 5 upgrade #6614

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
fail-fast: false
matrix:
python-version:
- '3.9'
- '3.10'

# required for poetry action
# see https://github.com/marketplace/actions/install-poetry-action#running-on-windows
Expand Down
9 changes: 8 additions & 1 deletion label_studio/core/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,14 @@
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
STATICFILES_STORAGE = 'core.storage.SkipMissedManifestStaticFilesStorage'
STORAGES = {
'default': {
'BACKEND': 'django.core.files.storage.FileSystemStorage',
},
'staticfiles': {
'BACKEND': 'core.storage.SkipMissedManifestStaticFilesStorage',
},
}

# Sessions and CSRF
SESSION_COOKIE_SECURE = bool(int(get_env('SESSION_COOKIE_SECURE', False)))
Expand Down
10 changes: 5 additions & 5 deletions label_studio/data_manager/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def annotate_annotations_results(queryset):
)
)
else:
return queryset.annotate(annotations_results=ArrayAgg('annotations__result', distinct=True))
return queryset.annotate(annotations_results=ArrayAgg('annotations__result', distinct=True, default=Value([])))


def annotate_predictions_results(queryset):
Expand All @@ -612,7 +612,7 @@ def annotate_predictions_results(queryset):
)
)
else:
return queryset.annotate(predictions_results=ArrayAgg('predictions__result', distinct=True))
return queryset.annotate(predictions_results=ArrayAgg('predictions__result', distinct=True, default=Value([])))


def annotate_annotators(queryset):
Expand All @@ -621,7 +621,7 @@ def annotate_annotators(queryset):
annotators=Coalesce(GroupConcat('annotations__completed_by'), Value(''), output_field=models.CharField())
)
else:
return queryset.annotate(annotators=ArrayAgg('annotations__completed_by', distinct=True))
return queryset.annotate(annotators=ArrayAgg('annotations__completed_by', distinct=True, default=Value([])))


def annotate_predictions_score(queryset):
Expand Down Expand Up @@ -655,7 +655,7 @@ def annotate_annotations_ids(queryset):
if settings.DJANGO_DB == settings.DJANGO_DB_SQLITE:
return queryset.annotate(annotations_ids=GroupConcat('annotations__id', output_field=models.CharField()))
else:
return queryset.annotate(annotations_ids=ArrayAgg('annotations__id'))
return queryset.annotate(annotations_ids=ArrayAgg('annotations__id', default=Value([])))


def annotate_predictions_model_versions(queryset):
Expand All @@ -664,7 +664,7 @@ def annotate_predictions_model_versions(queryset):
predictions_model_versions=GroupConcat('predictions__model_version', output_field=models.CharField())
)
else:
return queryset.annotate(predictions_model_versions=ArrayAgg('predictions__model_version'))
return queryset.annotate(predictions_model_versions=ArrayAgg('predictions__model_version', default=Value([])))


def annotate_avg_lead_time(queryset):
Expand Down
31 changes: 15 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exclude = [
label-studio = "label_studio.server:main"

[tool.poetry.dependencies]
python = ">=3.9,<4"
python = ">=3.10,<4"
wheel = "<=0.40.0,>=0.38.1"
appdirs = ">=1.4.3"
attr = "0.3.1"
Expand All @@ -154,7 +154,7 @@ boto = "^2.49.0"
boto3 = "^1.28.58"
botocore = "^1.31.58"
bleach = "~=5.0.0"
Django = "~=4.2.13"
Django = "~=5.1.3"
django-storages = "1.12.3"
django-annoying = "0.10.6"
django-debug-toolbar = "3.2.1"
Expand All @@ -169,7 +169,7 @@ django-ranged-fileresponse = ">=0.1.2"
drf-dynamic-fields = "0.3.0"
djangorestframework = "3.15.2"
drf-flex-fields = "0.9.5"
humansignal-drf-yasg = ">=1.21.9"
humansignal-drf-yasg = ">=1.21.10"
drf-generators = "0.3.0"
lockfile = ">=0.12.0"
lxml = {extras = ["html_clean"], version = ">=4.9.4"}
Expand Down
Loading