Skip to content

Commit bb611f2

Browse files
edx-requirements-botawais786
authored andcommitted
feat: add python 3.11 support
1 parent 516d289 commit bb611f2

20 files changed

+130
-160
lines changed

.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-20.04]
17-
python-version: ['3.8']
18-
toxenv: [py38-django32, py38-django42, quality]
17+
python-version:
18+
- '3.8'
19+
- '3.11'
20+
toxenv: [django42, quality]
1921

2022
steps:
2123
- uses: actions/checkout@v2

.tx/config

-9
This file was deleted.

CHANGELOG.rst

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel
1515

1616
Unreleased
1717
~~~~~~~~~~
18+
9.10.0 - 2024-02-29
19+
------------------
20+
* Remove Transifex calls and bundled translation files for the OEP-58 proposal.
21+
* BREAKING CHANGE: This version breaks translations with Quince and earlier releases.
22+
* Adding python 3.12 support. Dropping django32 support.
23+
24+
9.9.0 (2024-01-24)
25+
---------------------------
26+
* XBlockI18NService js translations support
27+
1828
9.8.3 - 2024-01-23
1929
------------------
2030
* Additional NewRelic traces to functions suspected of causing performance issues.

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with
4343
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
4444
pip install -qr requirements/pip.txt
4545
pip install -qr requirements/pip_tools.txt
46+
sed 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
47+
mv requirements/common_constraints.tmp requirements/common_constraints.txt
4648
pip-compile --upgrade -o requirements/base.txt requirements/base.in
4749
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
4850
pip-compile --upgrade -o requirements/test.txt requirements/test.in

README.rst

-11
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,6 @@ This list is what is used to resolve dependencies when an upstream project is co
124124
this XBlock package. requirements.txt is used to install the same dependencies when running
125125
the tests for this package.
126126

127-
Downloading translations from Transifex
128-
---------------------------------------
129-
130-
If you want to download translations from Transifex install
131-
`transifex client <https://docs.transifex.com/client/installing-the-client/>`_ and run this command while
132-
inside project root directory:
133-
134-
.. code:: bash
135-
136-
$ tx pull -f --mode=reviewed
137-
138127
Further Development Info
139128
------------------------
140129

catalog-info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ metadata:
1616
spec:
1717
type: XBlock
1818
lifecycle: production
19-
owner: masters-devs-cosmonauts
19+
owner: ~
2020
subcomponentOf: LTI

lti_consumer/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from .apps import LTIConsumerApp
55
from .lti_xblock import LtiConsumerXBlock
66

7-
__version__ = '9.8.3'
7+
__version__ = '9.10.0'

lti_consumer/conf/locale/config.yaml

-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
locales:
44
- en # English - Source Language
5-
- ar # Arabic
6-
- es_419 # Spanish (Latin America)
7-
- fr # French
8-
- he # Hebrew
9-
- hi # Hindi
10-
- ja_JP # Japanese (Japan)
11-
- ko_KR # Korean (Korea)
12-
- pt_BR # Portuguese (Brazil)
13-
- pt_PT # Portuguese (Portugal)
14-
- ru # Russian
15-
- zh_CN # Chinese (China)
165

176
# Directories we don't search for strings.
187
ignore_dirs:

lti_consumer/lti_xblock.py

+15-20
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@
5555
import urllib.parse
5656
from collections import namedtuple
5757
from importlib import import_module
58-
import pkg_resources
5958

6059
import bleach
6160
from django.conf import settings
62-
from django.utils import timezone, translation
61+
from django.utils import timezone
6362
from web_fragments.fragment import Fragment
6463

6564
from webob import Response
@@ -257,6 +256,7 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock):
257256
"""
258257

259258
block_settings_key = 'lti_consumer'
259+
i18n_js_namespace = 'XBlockLtiConsumerI18N'
260260

261261
display_name = String(
262262
display_name=_("Display Name"),
@@ -662,20 +662,15 @@ def workbench_scenarios():
662662
]
663663
return scenarios
664664

665-
@staticmethod
666-
def _get_statici18n_js_url(loader): # pragma: no cover
667-
"""
668-
Returns the Javascript translation file for the currently selected language, if any found by
669-
`pkg_resources`
670-
"""
671-
lang_code = translation.get_language()
672-
if not lang_code:
673-
return None
674-
text_js = 'public/js/translations/{lang_code}/text.js'
675-
country_code = lang_code.split('-')[0]
676-
for code in (translation.to_locale(lang_code), lang_code, country_code):
677-
if pkg_resources.resource_exists(loader.module_name, text_js.format(lang_code=code)):
678-
return text_js.format(lang_code=code)
665+
def _get_statici18n_js_url(self):
666+
"""
667+
Return the JavaScript translation file provided by the XBlockI18NService.
668+
"""
669+
if i18n_service := self.runtime.service(self, 'i18n'):
670+
if url_getter_func := getattr(i18n_service, 'get_javascript_i18n_catalog_url', None):
671+
if javascript_url := url_getter_func(self):
672+
return javascript_url
673+
679674
return None
680675

681676
def validate_field_data(self, validation, data):
@@ -1197,9 +1192,9 @@ def author_view(self, context):
11971192
)
11981193
fragment.add_css(loader.load_unicode('static/css/student.css'))
11991194
fragment.add_javascript(loader.load_unicode('static/js/xblock_lti_consumer.js'))
1200-
statici18n_js_url = self._get_statici18n_js_url(loader)
1195+
statici18n_js_url = self._get_statici18n_js_url()
12011196
if statici18n_js_url:
1202-
fragment.add_javascript_url(self.runtime.local_resource_url(self, statici18n_js_url))
1197+
fragment.add_javascript_url(statici18n_js_url)
12031198
fragment.initialize_js('LtiConsumerXBlock')
12041199
return fragment
12051200

@@ -1224,9 +1219,9 @@ def student_view(self, context):
12241219
fragment.add_content(loader.render_mako_template('/templates/html/student.html', context))
12251220
fragment.add_css(loader.load_unicode('static/css/student.css'))
12261221
fragment.add_javascript(loader.load_unicode('static/js/xblock_lti_consumer.js'))
1227-
statici18n_js_url = self._get_statici18n_js_url(loader)
1222+
statici18n_js_url = self._get_statici18n_js_url()
12281223
if statici18n_js_url:
1229-
fragment.add_javascript_url(self.runtime.local_resource_url(self, statici18n_js_url))
1224+
fragment.add_javascript_url(statici18n_js_url)
12301225
fragment.initialize_js('LtiConsumerXBlock')
12311226
return fragment
12321227

requirements/base.txt

+11-9
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ asgiref==3.7.2
1010
# via django
1111
attrs==23.2.0
1212
# via -r requirements/base.in
13+
backports-zoneinfo==0.2.1 ; python_version < "3.9"
14+
# via
15+
# -c requirements/constraints.txt
16+
# django
1317
bleach==6.1.0
1418
# via -r requirements/base.in
15-
boto3==1.34.45
19+
boto3==1.34.52
1620
# via fs-s3fs
17-
botocore==1.34.45
21+
botocore==1.34.52
1822
# via
1923
# boto3
2024
# s3transfer
@@ -26,9 +30,8 @@ charset-normalizer==3.3.2
2630
# via requests
2731
click==8.1.7
2832
# via edx-django-utils
29-
django==3.2.24
33+
django==4.2.10
3034
# via
31-
# -c requirements/common_constraints.txt
3235
# -r requirements/base.in
3336
# django-appconf
3437
# django-config-models
@@ -70,7 +73,7 @@ fs==2.4.16
7073
# xblock
7174
fs-s3fs==1.1.1
7275
# via openedx-django-pyfs
73-
future==0.18.3
76+
future==1.0.0
7477
# via pyjwkest
7578
idna==3.6
7679
# via requests
@@ -94,7 +97,7 @@ markupsafe==2.1.5
9497
# via
9598
# mako
9699
# xblock
97-
newrelic==9.6.0
100+
newrelic==9.7.0
98101
# via edx-django-utils
99102
oauthlib==3.2.2
100103
# via -r requirements/base.in
@@ -124,7 +127,6 @@ python-dateutil==2.8.2
124127
# xblock
125128
pytz==2024.1
126129
# via
127-
# django
128130
# djangorestframework
129131
# xblock
130132
pyyaml==6.0.1
@@ -145,11 +147,11 @@ six==1.16.0
145147
# python-dateutil
146148
sqlparse==0.4.4
147149
# via django
148-
stevedore==5.1.0
150+
stevedore==5.2.0
149151
# via
150152
# edx-django-utils
151153
# edx-opaque-keys
152-
typing-extensions==4.9.0
154+
typing-extensions==4.10.0
153155
# via
154156
# asgiref
155157
# edx-opaque-keys

0 commit comments

Comments
 (0)