Skip to content

Commit

Permalink
Merge pull request #404 from openedx/cag/python-support
Browse files Browse the repository at this point in the history
build: python 3.11 and 3.12 support
  • Loading branch information
feanil committed May 17, 2024
2 parents a09e875 + eb801db commit 8328a10
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 39 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, docs, pii_check, django32, django42]
os: [ 'ubuntu-20.04' ]
python-version: ['3.8', '3.11', '3.12']
toxenv: [ 'django42' ]
# Only run these other workflows on the latest python version we support.
include:
- python-version: '3.12'
toxenv: 'quality'
os: 'ubuntu-20.04'
- python-version: '3.12'
toxenv: 'docs'
os: 'ubuntu-20.04'
- python-version: '3.12'
toxenv: 'pii_check'
os: 'ubuntu-20.04'

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
$(PIP_COMPILE) -o requirements/test.txt requirements/test.in
$(PIP_COMPILE) -o requirements/doc.txt requirements/doc.in
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) --allow-unsafe -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
# Let tox control the Django version for tests
Expand Down
2 changes: 1 addition & 1 deletion event_routing_backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Various backends for receiving edX LMS events..
"""

__version__ = '9.0.1'
__version__ = '9.1.0'
6 changes: 3 additions & 3 deletions event_routing_backends/processors/xapi/tests/test_xapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ def test_send_method_with_successfull_flow(self, mocked_logger, mocked_get_trans

self.processor([self.sample_event])

self.assertIn(call(transformed_event.to_json()), mocked_logger.mock_calls)
self.assertIn(call.info(transformed_event.to_json()), mocked_logger.mock_calls)

@patch(
'event_routing_backends.processors.xapi.transformer_processor.XApiTransformersRegistry.get_transformer'
)
@patch('event_routing_backends.processors.xapi.transformer_processor.xapi_logger')
def test_send_method_with_event_list_successfull_flow(self, mocked_logger, mocked_get_transformer):

transformed_event = Statement()
transformed_event.object = Activity(id=str(uuid.uuid4()))
mocked_transformer = MagicMock()
mocked_transformer.transform.return_value = [transformed_event]
mocked_get_transformer.return_value = mocked_transformer

self.processor([self.sample_event])

self.assertIn(call(transformed_event.to_json()), mocked_logger.mock_calls)
self.assertIn(call.info(transformed_event.to_json()), mocked_logger.mock_calls)

@patch(
'event_routing_backends.processors.xapi.transformer_processor.XApiTransformersRegistry.get_transformer'
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ apache-libcloud # For bulk event log loading
fasteners # Locking tools, required by apache-libcloud, but somehow not installed with it
openedx-filters
django-redis
setuptools # Python 3.12 requires setuptools package
7 changes: 3 additions & 4 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ async-timeout==4.0.3
# via redis
attrs==23.2.0
# via openedx-events
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# celery
# django
# djangorestframework
Expand Down Expand Up @@ -72,7 +73,7 @@ django==4.2.11
# jsonfield
# openedx-events
# openedx-filters
django-config-models==2.6.0
django-config-models==2.7.0
# via -r requirements/base.in
django-crum==0.7.9
# via
Expand Down Expand Up @@ -199,8 +200,6 @@ vine==5.1.0
# kombu
wcwidth==0.2.13
# via prompt-toolkit
wheel==0.43.0
# via django-config-models

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 2 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ sphinx==4.2.0
docutils<0.18
doc8<1.0.0
event-tracking>=2.3.2
# it is not availablein python3.9
backports.zoneinfo;python_version<"3.9"
6 changes: 3 additions & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ attrs==23.2.0
# via
# -r requirements/quality.txt
# openedx-events
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
# celery
# django
Expand Down Expand Up @@ -151,7 +152,7 @@ django==4.2.11
# jsonfield
# openedx-events
# openedx-filters
django-config-models==2.6.0
django-config-models==2.7.0
# via -r requirements/quality.txt
django-crum==0.7.9
# via
Expand Down Expand Up @@ -494,7 +495,6 @@ wheel==0.43.0
# via
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# django-config-models
# pip-tools
zipp==3.18.1
# via
Expand Down
9 changes: 3 additions & 6 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ babel==2.14.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
# celery
# django
Expand Down Expand Up @@ -121,7 +122,7 @@ django==4.2.11
# jsonfield
# openedx-events
# openedx-filters
django-config-models==2.6.0
django-config-models==2.7.0
# via -r requirements/test.txt
django-crum==0.7.9
# via
Expand Down Expand Up @@ -451,10 +452,6 @@ wcwidth==0.2.13
# via
# -r requirements/test.txt
# prompt-toolkit
wheel==0.43.0
# via
# -r requirements/test.txt
# django-config-models
zipp==3.18.1
# via
# importlib-metadata
Expand Down
2 changes: 2 additions & 0 deletions requirements/quality.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ edx-lint # edX pylint rules and plugins
isort # to standardize order of imports
pycodestyle # PEP 8 compliance validation
pydocstyle # PEP 257 compliance validation
wheel
setuptools
12 changes: 6 additions & 6 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ attrs==23.2.0
# via
# -r requirements/test.txt
# openedx-events
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/test.txt
# celery
# django
Expand Down Expand Up @@ -119,7 +120,7 @@ django==4.2.11
# jsonfield
# openedx-events
# openedx-filters
django-config-models==2.6.0
django-config-models==2.7.0
# via -r requirements/test.txt
django-crum==0.7.9
# via
Expand Down Expand Up @@ -376,9 +377,8 @@ wcwidth==0.2.13
# -r requirements/test.txt
# prompt-toolkit
wheel==0.43.0
# via
# -r requirements/test.txt
# django-config-models
# via -r requirements/quality.in

# The following packages are considered to be unsafe in a requirements file:
# setuptools
setuptools==69.2.0
# via -r requirements/quality.in
12 changes: 3 additions & 9 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ attrs==23.2.0
# via
# -r requirements/base.txt
# openedx-events
backports-zoneinfo[tzdata]==0.2.1
backports-zoneinfo[tzdata]==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# celery
# django
Expand Down Expand Up @@ -106,7 +107,7 @@ ddt==1.7.2
# jsonfield
# openedx-events
# openedx-filters
django-config-models==2.6.0
django-config-models==2.7.0
# via -r requirements/base.txt
django-crum==0.7.9
# via
Expand Down Expand Up @@ -314,10 +315,3 @@ wcwidth==0.2.13
# via
# -r requirements/base.txt
# prompt-toolkit
wheel==0.43.0
# via
# -r requirements/base.txt
# django-config-models

# The following packages are considered to be unsafe in a requirements file:
# setuptools
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,14 @@ def is_requirement(line):
classifiers=[
'Development Status :: 3 - Alpha',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
entry_points={
"lms.djangoapp": [
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-django{32,42}, quality, docs, pii_check
envlist = py{38,311,312}-django{42}, quality, docs, pii_check

[doc8]
ignore = D001
Expand Down Expand Up @@ -35,7 +35,6 @@ norecursedirs = .* docs requirements site-packages

[testenv]
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
commands =
Expand Down

0 comments on commit 8328a10

Please sign in to comment.