Skip to content

Commit

Permalink
Django 4.2 upgrade (#1134)
Browse files Browse the repository at this point in the history
* fix: django-4.2 upgrade

---------

Co-authored-by: Salman Nawaz <[email protected]>
  • Loading branch information
salman2013 and Salman Nawaz authored Jul 12, 2023
1 parent f02f8aa commit 8abd639
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 42 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ jobs:
[
"django32-drflatest",
"django40-drflatest",
"django42-drflatest",
"quality",
"pii_check",
"version_check",
"js_tests",
"js_lint",
"rst_validation",
"translations",
"translations-django32",
"translations-django42",
]
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -57,7 +59,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.toxenv == 'django32-drflatest'
if: matrix.toxenv == 'django42-drflatest'
uses: codecov/codecov-action@v3
with:
flags: unittests
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Change Log
Unreleased
~~~~~~~~~~
[4.16.0] - 2023-06-22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Support added for Django 4.2

[4.15.1] - 2023-04-19
~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 1 addition & 3 deletions edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '4.15.1'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
__version__ = '4.16.0'
12 changes: 5 additions & 7 deletions edx_proctoring/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Meta:
fields = '__all__'


@admin.register(ProctoredExam)
class ProctoredExamAdmin(admin.ModelAdmin):
"""
Admin panel for Proctored Exams
Expand All @@ -51,6 +52,7 @@ class ProctoredExamAdmin(admin.ModelAdmin):
search_fields = ['course_id', 'exam_name']


@admin.register(ProctoredExamReviewPolicy)
class ProctoredExamReviewPolicyAdmin(admin.ModelAdmin):
"""
The admin panel for Review Policies
Expand Down Expand Up @@ -244,6 +246,7 @@ def queryset(self, request, queryset):
)


@admin.register(ProctoredExamSoftwareSecureReview)
class ProctoredExamSoftwareSecureReviewAdmin(admin.ModelAdmin):
"""
The admin panel for SoftwareSecure Review records
Expand Down Expand Up @@ -320,6 +323,7 @@ def lookup_allowed(self, lookup, value):
return super().lookup_allowed(lookup, value)


@admin.register(ProctoredExamSoftwareSecureReviewHistory)
class ProctoredExamSoftwareSecureReviewHistoryAdmin(ProctoredExamSoftwareSecureReviewAdmin):
"""
The admin panel for SoftwareSecure Review records
Expand Down Expand Up @@ -408,6 +412,7 @@ class Meta:
status = forms.ChoiceField(choices=STATUS_CHOICES)


@admin.register(ProctoredExamStudentAttempt)
class ProctoredExamStudentAttemptAdmin(SimpleHistoryAdmin):
"""
Admin panel for Proctored Exam Attempts
Expand Down Expand Up @@ -495,10 +500,3 @@ def prettify_course_id(course_id):
Prettify the COURSE ID string
"""
return course_id.replace('+', ' ').replace('/', ' ').replace('course-v1:', '')


admin.site.register(ProctoredExam, ProctoredExamAdmin)
admin.site.register(ProctoredExamStudentAttempt, ProctoredExamStudentAttemptAdmin)
admin.site.register(ProctoredExamReviewPolicy, ProctoredExamReviewPolicyAdmin)
admin.site.register(ProctoredExamSoftwareSecureReview, ProctoredExamSoftwareSecureReviewAdmin)
admin.site.register(ProctoredExamSoftwareSecureReviewHistory, ProctoredExamSoftwareSecureReviewHistoryAdmin)
3 changes: 1 addition & 2 deletions edx_proctoring/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ def test_get_practice_proctored_exams_for_course(self):
)

self.assertQuerysetEqual(
ProctoredExam.get_practice_proctored_exams_for_course(course_id),
[repr(exam) for exam in practice_proctored_exams]
ProctoredExam.get_practice_proctored_exams_for_course(course_id), list(practice_proctored_exams)
)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@edx/edx-proctoring",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "4.15.1",
"version": "4.16.0",
"main": "edx_proctoring/static/index.js",
"scripts": {
"test": "gulp test"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def is_requirement(line):
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
Expand Down
3 changes: 1 addition & 2 deletions test_urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@


from django.conf import settings
from django.conf.urls import include

from edx_proctoring import views
from django.urls import path, re_path
from django.urls import include, path, re_path

urlpatterns = [
path('', include('edx_proctoring.urls', namespace='edx_proctoring')),
Expand Down
55 changes: 30 additions & 25 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,80 +1,85 @@
[tox]
envlist =
py38-celery{50}-django{32, 40}-drflatest
quality,
version_check,
pii_check,
translations
envlist =
py38-celery{50}-django{32,40,42}-drflatest
quality,
version_check,
pii_check,
translations-django{32, 42}

[testenv]
deps =
deps =
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django42: Django>=4.2,<4.3
drflatest: djangorestframework
celery50: -r{toxinidir}/requirements/celery50.txt
-rrequirements/test.txt
commands =
commands =
python -Wd -m pytest {posargs:-n 3}

[testenv:js_tests]
whitelist_externals =
whitelist_externals =
npm
make
commands =
commands =
npm install -g gulp-cli
npm install
make test-js

[testenv:js_lint]
whitelist_externals =
whitelist_externals =
npm
make
commands =
commands =
npm install -g gulp-cli
npm install
make lint-js

[testenv:rst_validation]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
-r{toxinidir}/requirements/quality.txt
commands =
commands =
make quality-rst

[testenv:quality]
whitelist_externals =
whitelist_externals =
make
rm
touch
deps =
deps =
-r{toxinidir}/requirements/quality.txt
-r{toxinidir}/requirements/test.txt
commands =
commands =
pylint edx_proctoring
pycodestyle edx_proctoring
isort --check-only --diff edx_proctoring manage.py setup.py

[testenv:version_check]
deps =
deps =
-r{toxinidir}/requirements/base.txt
commands =
commands =
{toxinidir}/edx_proctoring/scripts/version_check.py

[testenv:pii_check]
whitelist_externals =
whitelist_externals =
make
deps =
deps =
-r{toxinidir}/requirements/test.txt
Django>=3.2,<3.3
commands =
commands =
make pii_check

[testenv:translations]
whitelist_externals =
whitelist_externals =
make
deps =
django32: Django>=3.2,<3.3
django42: Django>=4.2,<4.3
-rrequirements/test.txt
commands =
commands =
sudo apt-get update
sudo apt-get install --no-install-recommends -y gettext
make validate_translations

0 comments on commit 8abd639

Please sign in to comment.