Skip to content

Commit

Permalink
Merge pull request #115 from openedx/salman/djang0-4.2-support
Browse files Browse the repository at this point in the history
Add django 4.2 suppport
  • Loading branch information
salman2013 authored Jul 31, 2023
2 parents b7cef02 + eac0cc6 commit 39dd7f9
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22, django30, django31, django32, quality, csslint, eslint]
toxenv: [django32, django42, quality, csslint, eslint]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ Version 0.5
Version 1.1.0

Added support for django 3.2
Version 1.2.0

Added support for django 4.2
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import find_packages, setup

version = '1.1.3'
version = '1.2.0'
description = __doc__.strip().split('\n')[0]
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.rst')) as file_in:
Expand Down Expand Up @@ -121,10 +121,8 @@ def is_requirement(line):
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.8',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Topic :: Education',
'Topic :: Internet :: WWW/HTTP',
],
Expand Down
10 changes: 5 additions & 5 deletions submit_and_compare/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"""
import logging

from django.utils.translation import ungettext
from django.utils.translation import ugettext as _
from django.utils.translation import ngettext
from django.utils.translation import gettext as _
from lxml import etree
from six import StringIO
from xblock.core import XBlock
Expand Down Expand Up @@ -237,7 +237,7 @@ def _get_used_attempts_feedback(self):
result = ''
if self.max_attempts > 0:
# pylint: disable=no-member
result = ungettext(
result = ngettext(
'You have used {count_attempts} of {max_attempts} submission',
'You have used {count_attempts} of {max_attempts} submissions',
self.max_attempts,
Expand Down Expand Up @@ -280,7 +280,7 @@ def _get_problem_progress(self):
result = ''
elif self.score == 0.0:
result = "({})".format(
ungettext(
ngettext(
'{weight} point possible',
'{weight} points possible',
self.weight,
Expand All @@ -292,7 +292,7 @@ def _get_problem_progress(self):
scaled_score = self.score * self.weight
score_string = f'{scaled_score:g}'
result = "({})".format(
ungettext(
ngettext(
score_string + '/' + "{weight} point",
score_string + '/' + "{weight} points",
self.weight,
Expand Down
34 changes: 16 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
[tox]
envlist = csslint,eslint,pycodestyle,pylint,py38-django{22,30,31,32}
envlist = csslint,eslint,pycodestyle,pylint,py38-django{32,42}

[testenv]
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
django32: Django>=3.2,<4.0
-rrequirements/test.txt
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-rrequirements/test.txt
commands =
coverage run manage.py test
coverage report
coverage html
coverage run manage.py test
coverage report
coverage html

[testenv:clean]
commands =
coverage erase
coverage erase
deps =
-rrequirements/test.txt
-rrequirements/test.txt
skip_install = True

[testenv:csslint]
whitelist_externals = {toxinidir}/node_modules/csslint/dist/cli.js
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
commands =
{toxinidir}/node_modules/csslint/dist/cli.js submit_and_compare/public/
{toxinidir}/node_modules/csslint/dist/cli.js submit_and_compare/public/
deps =
skip_install = True

[testenv:eslint]
whitelist_externals = {toxinidir}/node_modules/eslint/bin/eslint.js
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
commands =
{toxinidir}/node_modules/eslint/bin/eslint.js --fix submit_and_compare/public/view.js
{toxinidir}/node_modules/eslint/bin/eslint.js --fix submit_and_compare/public/view.js
deps =
skip_install = True

[testenv:quality]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
-rrequirements/quality.txt
-rrequirements/quality.txt
commands =
pycodestyle --max-line-length=120 submit_and_compare/
pylint --rcfile=pylintrc submit_and_compare/
pycodestyle --max-line-length=120 submit_and_compare/
pylint --rcfile=pylintrc submit_and_compare/

[testenv:transifex]
deps =
transifex-client
transifex-client
commands =
tx push -s
tx push -s

0 comments on commit 39dd7f9

Please sign in to comment.