Skip to content

Commit f9eeaad

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

22 files changed

+284
-254
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

.github/workflows/upgrade-python-requirements.yml

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
# optional parameters below; fill in if you'd like github or email notifications
1919
# user_reviewers: ""
2020
# team_reviewers: ""
21-
email_address: "[email protected]"
22-
send_success_notification: true
2321
secrets:
2422
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
2523
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}

.tx/config

-9
This file was deleted.

CHANGELOG.rst

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

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

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with
4949
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
5050
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
5151
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
52-
# Let tox control the Django version version for tests
53-
grep -e "^django==" requirements/test.txt > requirements/django.txt
54-
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
55-
mv requirements/test.tmp requirements/test.txt
5652

5753

5854
## Localization targets

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

+28-25
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
#
77
appdirs==1.4.4
88
# via fs
9-
asgiref==3.7.2
9+
asgiref==3.8.1
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
17+
# djangorestframework
1318
bleach==6.1.0
1419
# via -r requirements/base.in
15-
boto3==1.34.45
20+
boto3==1.34.83
1621
# via fs-s3fs
17-
botocore==1.34.45
22+
botocore==1.34.83
1823
# via
1924
# boto3
2025
# s3transfer
@@ -26,7 +31,7 @@ charset-normalizer==3.3.2
2631
# via requests
2732
click==8.1.7
2833
# via edx-django-utils
29-
django==3.2.24
34+
django==4.2.11
3035
# via
3136
# -c requirements/common_constraints.txt
3237
# -r requirements/base.in
@@ -43,21 +48,21 @@ django==3.2.24
4348
# openedx-filters
4449
django-appconf==1.0.6
4550
# via django-statici18n
46-
django-config-models==2.5.1
51+
django-config-models==2.7.0
4752
# via -r requirements/base.in
4853
django-crum==0.7.9
4954
# via edx-django-utils
50-
django-filter==23.5
55+
django-filter==24.2
5156
# via -r requirements/base.in
5257
django-statici18n==2.4.0
5358
# via -r requirements/base.in
5459
django-waffle==4.1.0
5560
# via edx-django-utils
56-
djangorestframework==3.14.0
61+
djangorestframework==3.15.1
5762
# via django-config-models
5863
edx-ccx-keys==1.2.1
5964
# via -r requirements/base.in
60-
edx-django-utils==5.10.1
65+
edx-django-utils==5.12.0
6166
# via django-config-models
6267
edx-opaque-keys[django]==2.5.1
6368
# via
@@ -70,9 +75,9 @@ fs==2.4.16
7075
# xblock
7176
fs-s3fs==1.1.1
7277
# via openedx-django-pyfs
73-
future==0.18.3
78+
future==1.0.0
7479
# via pyjwkest
75-
idna==3.6
80+
idna==3.7
7681
# via requests
7782
jmespath==1.0.1
7883
# via
@@ -82,31 +87,32 @@ jsonfield==3.1.0
8287
# via -r requirements/base.in
8388
lazy==1.6
8489
# via -r requirements/base.in
85-
lxml==5.1.0
90+
lxml==4.9.4
8691
# via
92+
# -c requirements/constraints.txt
8793
# -r requirements/base.in
8894
# xblock
89-
mako==1.3.2
95+
mako==1.3.3
9096
# via
9197
# -r requirements/base.in
9298
# xblock
9399
markupsafe==2.1.5
94100
# via
95101
# mako
96102
# xblock
97-
newrelic==9.6.0
103+
newrelic==9.8.0
98104
# via edx-django-utils
99105
oauthlib==3.2.2
100106
# via -r requirements/base.in
101-
openedx-django-pyfs==3.5.0
107+
openedx-django-pyfs==3.6.0
102108
# via -r requirements/base.in
103109
openedx-filters==1.6.0
104110
# via -r requirements/base.in
105111
pbr==6.0.0
106112
# via stevedore
107113
psutil==5.9.8
108114
# via edx-django-utils
109-
pycparser==2.21
115+
pycparser==2.22
110116
# via cffi
111117
pycryptodomex==3.20.0
112118
# via
@@ -118,20 +124,17 @@ pymongo==3.13.0
118124
# via edx-opaque-keys
119125
pynacl==1.5.0
120126
# via edx-django-utils
121-
python-dateutil==2.8.2
127+
python-dateutil==2.9.0.post0
122128
# via
123129
# botocore
124130
# xblock
125131
pytz==2024.1
126-
# via
127-
# django
128-
# djangorestframework
129-
# xblock
132+
# via xblock
130133
pyyaml==6.0.1
131134
# via xblock
132135
requests==2.31.0
133136
# via pyjwkest
134-
s3transfer==0.10.0
137+
s3transfer==0.10.1
135138
# via boto3
136139
simplejson==3.19.2
137140
# via xblock
@@ -145,11 +148,11 @@ six==1.16.0
145148
# python-dateutil
146149
sqlparse==0.4.4
147150
# via django
148-
stevedore==5.1.0
151+
stevedore==5.2.0
149152
# via
150153
# edx-django-utils
151154
# edx-opaque-keys
152-
typing-extensions==4.9.0
155+
typing-extensions==4.11.0
153156
# via
154157
# asgiref
155158
# edx-opaque-keys
@@ -158,13 +161,13 @@ urllib3==1.26.18
158161
# -c requirements/constraints.txt
159162
# botocore
160163
# requests
161-
web-fragments==2.1.0
164+
web-fragments==2.2.0
162165
# via xblock
163166
webencodings==0.5.1
164167
# via bleach
165168
webob==1.8.7
166169
# via xblock
167-
xblock==1.10.0
170+
xblock==3.1.0
168171
# via -r requirements/base.in
169172

170173
# The following packages are considered to be unsafe in a requirements file:

0 commit comments

Comments
 (0)