Skip to content

Commit

Permalink
Bump pip from 21.0.1 to 22.0.2, setuptools from 53.0.0 to 60.6.0, whe…
Browse files Browse the repository at this point in the history
…el from 0.36.2 to 0.37.1 (#4267)

* bump pip from 21.0.1 to 22.0.2, setuptools from 53.0.0 to 60.6.0, wheel from 0.36.2 to 0.37.1
* used maintained django_sendfile2 package instead of django sendfile
* fixed cy tests due django_sendfile used wrong header
  • Loading branch information
Andrey Zhavoronkov authored Jan 31, 2022
1 parent 9fc6a1e commit 2b50abb
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Users don't have access to a task object anymore if they are assigneed only on some jobs of the task (<https://github.com/openvinotoolkit/cvat/pull/3788>)
- Different resources (tasks, projects) are not visible anymore for all CVAT instance users by default (<https://github.com/openvinotoolkit/cvat/pull/3788>)
- Replaced 'django_sendfile' with 'django_sendfile2' (<https://github.com/openvinotoolkit/cvat/pull/4267>)

### Deprecated
- Job field "status" is not used in UI anymore, but it has not been removed from the database yet (<https://github.com/openvinotoolkit/cvat/pull/3788>)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN curl -sL https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 --outp
# Install requirements
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
RUN python3 -m pip install --no-cache-dir -U pip==21.0.1 setuptools==53.0.0 wheel==0.36.2
RUN python3 -m pip install --no-cache-dir -U pip==22.0.2 setuptools==60.6.0 wheel==0.37.1
COPY cvat/requirements/ /tmp/requirements/
RUN DATUMARO_HEADLESS=1 python3 -m pip install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt

Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from sendfile import sendfile
from django_sendfile import sendfile

import cvat.apps.dataset_manager as dm
from cvat.apps.engine import models
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework.exceptions import PermissionDenied
from sendfile import sendfile
from django_sendfile import sendfile

import cvat.apps.dataset_manager as dm
import cvat.apps.dataset_manager.views # pylint: disable=unused-import
Expand Down
2 changes: 1 addition & 1 deletion cvat/apps/opencv/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import glob
from django.conf import settings
from sendfile import sendfile
from django_sendfile import sendfile

def OpenCVLibrary(request):
dirname = os.path.join(settings.STATIC_ROOT, 'opencv', 'js')
Expand Down
2 changes: 1 addition & 1 deletion cvat/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ requests==2.26.0
rq==1.5.1
rq-scheduler==0.10.0
sqlparse==0.4.2
django-sendfile==0.3.11
django-sendfile2==0.6.1
dj-pagination==2.5.0
python-logstash-async==2.2.0
django-revproxy==0.10.0
Expand Down
7 changes: 6 additions & 1 deletion cvat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def add_ssh_keys():
'django.contrib.staticfiles',
'django_rq',
'compressor',
'sendfile',
'django_sendfile',
'dj_pagination',
'revproxy',
'rest_framework',
Expand Down Expand Up @@ -498,3 +498,8 @@ def add_ssh_keys():
# More about forwarded headers - https://doc.traefik.io/traefik/getting-started/faq/#what-are-the-forwarded-headers-when-proxying-http-requests
# How django uses X-Forwarded-Proto - https://docs.djangoproject.com/en/2.2/ref/settings/#secure-proxy-ssl-header
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')


# Django-sendfile requires to set SENDFILE_ROOT
# https://github.com/moggers87/django-sendfile2
SENDFILE_ROOT = BASE_DIR
4 changes: 2 additions & 2 deletions cvat/settings/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
ALLOWED_HOSTS.append('testserver')

# Django-sendfile:
# https://github.com/johnsensible/django-sendfile
SENDFILE_BACKEND = 'sendfile.backends.development'
# https://github.com/moggers87/django-sendfile2
SENDFILE_BACKEND = 'django_sendfile.backends.development'

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
Expand Down
4 changes: 2 additions & 2 deletions cvat/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
RQ_QUEUES[key]['HOST'] = os.getenv('CVAT_REDIS_HOST', 'cvat_redis')

# Django-sendfile:
# https://github.com/johnsensible/django-sendfile
SENDFILE_BACKEND = 'sendfile.backends.xsendfile'
# https://github.com/moggers87/django-sendfile2
SENDFILE_BACKEND = 'django_sendfile.backends.xsendfile'

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
Expand Down
5 changes: 3 additions & 2 deletions tests/cypress/support/commands_projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ Cypress.Commands.add('restoreProject', (archiveWithBackup) => {
Cypress.Commands.add('getDownloadFileName', () => {
cy.intercept('GET', '**=download').as('download');
cy.wait('@download').then((download) => {
const filename = download.response.headers['content-disposition'].split('filename="b\'')[1].split('\'')[0];
return filename;
const filename = download.response.headers['content-disposition'].split(';')[1].split('filename=')[1];
// need to remove quotes
return filename.substring(1, filename.length - 1);
});
});

Expand Down

0 comments on commit 2b50abb

Please sign in to comment.