Skip to content

Commit

Permalink
feat: add python 3.11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
edx-requirements-bot authored and awais786 committed Apr 11, 2024
1 parent 516d289 commit f9eeaad
Show file tree
Hide file tree
Showing 22 changed files with 284 additions and 254 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [py38-django32, py38-django42, quality]
python-version:
- '3.8'
- '3.11'
toxenv: [django42, quality]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
# optional parameters below; fill in if you'd like github or email notifications
# user_reviewers: ""
# team_reviewers: ""
email_address: "[email protected]"
send_success_notification: true
secrets:
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
Expand Down
9 changes: 0 additions & 9 deletions .tx/config

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel

Unreleased
~~~~~~~~~~

9.10.0 - 2024-02-29
------------------
* Remove Transifex calls and bundled translation files for the OEP-58 proposal.
* BREAKING CHANGE: This version breaks translations with Quince and earlier releases.
* Adding python 3.11 support. Dropping django32 support.

9.9.0 (2024-01-24)
---------------------------
* XBlockI18NService js translations support

9.8.3 - 2024-01-23
------------------
* Additional NewRelic traces to functions suspected of causing performance issues.
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
# Let tox control the Django version version for tests
grep -e "^django==" requirements/test.txt > requirements/django.txt
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt


## Localization targets
Expand Down
11 changes: 0 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ This list is what is used to resolve dependencies when an upstream project is co
this XBlock package. requirements.txt is used to install the same dependencies when running
the tests for this package.

Downloading translations from Transifex
---------------------------------------

If you want to download translations from Transifex install
`transifex client <https://docs.transifex.com/client/installing-the-client/>`_ and run this command while
inside project root directory:

.. code:: bash
$ tx pull -f --mode=reviewed
Further Development Info
------------------------

Expand Down
2 changes: 1 addition & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ metadata:
spec:
type: XBlock
lifecycle: production
owner: masters-devs-cosmonauts
owner: ~
subcomponentOf: LTI
2 changes: 1 addition & 1 deletion lti_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .apps import LTIConsumerApp
from .lti_xblock import LtiConsumerXBlock

__version__ = '9.8.3'
__version__ = '9.10.0'
11 changes: 0 additions & 11 deletions lti_consumer/conf/locale/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

locales:
- en # English - Source Language
- ar # Arabic
- es_419 # Spanish (Latin America)
- fr # French
- he # Hebrew
- hi # Hindi
- ja_JP # Japanese (Japan)
- ko_KR # Korean (Korea)
- pt_BR # Portuguese (Brazil)
- pt_PT # Portuguese (Portugal)
- ru # Russian
- zh_CN # Chinese (China)

# Directories we don't search for strings.
ignore_dirs:
Expand Down
35 changes: 15 additions & 20 deletions lti_consumer/lti_xblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@
import urllib.parse
from collections import namedtuple
from importlib import import_module
import pkg_resources

import bleach
from django.conf import settings
from django.utils import timezone, translation
from django.utils import timezone
from web_fragments.fragment import Fragment

from webob import Response
Expand Down Expand Up @@ -257,6 +256,7 @@ class LtiConsumerXBlock(StudioEditableXBlockMixin, XBlock):
"""

block_settings_key = 'lti_consumer'
i18n_js_namespace = 'XBlockLtiConsumerI18N'

display_name = String(
display_name=_("Display Name"),
Expand Down Expand Up @@ -662,20 +662,15 @@ def workbench_scenarios():
]
return scenarios

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

return None

def validate_field_data(self, validation, data):
Expand Down Expand Up @@ -1197,9 +1192,9 @@ def author_view(self, context):
)
fragment.add_css(loader.load_unicode('static/css/student.css'))
fragment.add_javascript(loader.load_unicode('static/js/xblock_lti_consumer.js'))
statici18n_js_url = self._get_statici18n_js_url(loader)
statici18n_js_url = self._get_statici18n_js_url()
if statici18n_js_url:
fragment.add_javascript_url(self.runtime.local_resource_url(self, statici18n_js_url))
fragment.add_javascript_url(statici18n_js_url)
fragment.initialize_js('LtiConsumerXBlock')
return fragment

Expand All @@ -1224,9 +1219,9 @@ def student_view(self, context):
fragment.add_content(loader.render_mako_template('/templates/html/student.html', context))
fragment.add_css(loader.load_unicode('static/css/student.css'))
fragment.add_javascript(loader.load_unicode('static/js/xblock_lti_consumer.js'))
statici18n_js_url = self._get_statici18n_js_url(loader)
statici18n_js_url = self._get_statici18n_js_url()
if statici18n_js_url:
fragment.add_javascript_url(self.runtime.local_resource_url(self, statici18n_js_url))
fragment.add_javascript_url(statici18n_js_url)
fragment.initialize_js('LtiConsumerXBlock')
return fragment

Expand Down
53 changes: 28 additions & 25 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@
#
appdirs==1.4.4
# via fs
asgiref==3.7.2
asgiref==3.8.1
# via django
attrs==23.2.0
# via -r requirements/base.in
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
# djangorestframework
bleach==6.1.0
# via -r requirements/base.in
boto3==1.34.45
boto3==1.34.83
# via fs-s3fs
botocore==1.34.45
botocore==1.34.83
# via
# boto3
# s3transfer
Expand All @@ -26,7 +31,7 @@ charset-normalizer==3.3.2
# via requests
click==8.1.7
# via edx-django-utils
django==3.2.24
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
Expand All @@ -43,21 +48,21 @@ django==3.2.24
# openedx-filters
django-appconf==1.0.6
# via django-statici18n
django-config-models==2.5.1
django-config-models==2.7.0
# via -r requirements/base.in
django-crum==0.7.9
# via edx-django-utils
django-filter==23.5
django-filter==24.2
# via -r requirements/base.in
django-statici18n==2.4.0
# via -r requirements/base.in
django-waffle==4.1.0
# via edx-django-utils
djangorestframework==3.14.0
djangorestframework==3.15.1
# via django-config-models
edx-ccx-keys==1.2.1
# via -r requirements/base.in
edx-django-utils==5.10.1
edx-django-utils==5.12.0
# via django-config-models
edx-opaque-keys[django]==2.5.1
# via
Expand All @@ -70,9 +75,9 @@ fs==2.4.16
# xblock
fs-s3fs==1.1.1
# via openedx-django-pyfs
future==0.18.3
future==1.0.0
# via pyjwkest
idna==3.6
idna==3.7
# via requests
jmespath==1.0.1
# via
Expand All @@ -82,31 +87,32 @@ jsonfield==3.1.0
# via -r requirements/base.in
lazy==1.6
# via -r requirements/base.in
lxml==5.1.0
lxml==4.9.4
# via
# -c requirements/constraints.txt
# -r requirements/base.in
# xblock
mako==1.3.2
mako==1.3.3
# via
# -r requirements/base.in
# xblock
markupsafe==2.1.5
# via
# mako
# xblock
newrelic==9.6.0
newrelic==9.8.0
# via edx-django-utils
oauthlib==3.2.2
# via -r requirements/base.in
openedx-django-pyfs==3.5.0
openedx-django-pyfs==3.6.0
# via -r requirements/base.in
openedx-filters==1.6.0
# via -r requirements/base.in
pbr==6.0.0
# via stevedore
psutil==5.9.8
# via edx-django-utils
pycparser==2.21
pycparser==2.22
# via cffi
pycryptodomex==3.20.0
# via
Expand All @@ -118,20 +124,17 @@ pymongo==3.13.0
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via
# botocore
# xblock
pytz==2024.1
# via
# django
# djangorestframework
# xblock
# via xblock
pyyaml==6.0.1
# via xblock
requests==2.31.0
# via pyjwkest
s3transfer==0.10.0
s3transfer==0.10.1
# via boto3
simplejson==3.19.2
# via xblock
Expand All @@ -145,11 +148,11 @@ six==1.16.0
# python-dateutil
sqlparse==0.4.4
# via django
stevedore==5.1.0
stevedore==5.2.0
# via
# edx-django-utils
# edx-opaque-keys
typing-extensions==4.9.0
typing-extensions==4.11.0
# via
# asgiref
# edx-opaque-keys
Expand All @@ -158,13 +161,13 @@ urllib3==1.26.18
# -c requirements/constraints.txt
# botocore
# requests
web-fragments==2.1.0
web-fragments==2.2.0
# via xblock
webencodings==0.5.1
# via bleach
webob==1.8.7
# via xblock
xblock==1.10.0
xblock==3.1.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
Loading

0 comments on commit f9eeaad

Please sign in to comment.