Skip to content

Commit

Permalink
build: python 3.11 and 3.12 support.
Browse files Browse the repository at this point in the history
build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

chore: Updating Python Requirements (#396)

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

build: python 3.11 and 3.12 support.

fix: include setuptools in quality requirements

chore: quality fixes
  • Loading branch information
awais786 authored and Ian2012 committed Mar 22, 2024
1 parent 40b3fdd commit 171c818
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, docs, pii_check, django32, django42]
python-version: ['3.8', '3.12']
toxenv: [quality, docs, pii_check, django42]

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
4 changes: 2 additions & 2 deletions event_routing_backends/backends/tests/test_events_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def test_time_to_send_no_data(self):


@ddt.ddt
class TestAsyncEventsRouter(TestEventsRouter): # pylint: disable=test-inherits-tests
class TestAsyncEventsRouter(TestEventsRouter): # pylint: disable=E7603
"""
Test the AsyncEventsRouter
"""
Expand Down Expand Up @@ -884,7 +884,7 @@ def test_successful_routing_of_bulk_events(


@ddt.ddt
class TestSyncEventsRouter(TestEventsRouter): # pylint: disable=test-inherits-tests
class TestSyncEventsRouter(TestEventsRouter): # pylint: disable=E7603
"""
Test the SyncEventsRouter
"""
Expand Down
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 @@ -64,22 +64,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
3 changes: 2 additions & 1 deletion 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
2 changes: 2 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ sphinx==4.2.0
# This pin can be removed once sphinx constraint is removed.
docutils<0.18
doc8<1.0.0
# it is not availablein python3.9
backports.zoneinfo;python_version<"3.9"
4 changes: 3 additions & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,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 @@ -494,6 +495,7 @@ wcwidth==0.2.13
wheel==0.43.0
# via
# -r requirements/pip-tools.txt
# -r requirements/quality.txt
# pip-tools
zipp==3.18.1
# via
Expand Down
13 changes: 4 additions & 9 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 @@ -106,7 +107,6 @@ ddt==1.7.2
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/test.txt
# django-config-models
# django-crum
# django-fernet-fields-v2
Expand Down Expand Up @@ -214,10 +214,6 @@ isodate==0.6.1
# via -r requirements/test.txt
jaraco-classes==3.3.1
# via keyring
jeepney==0.8.0
# via
# keyring
# secretstorage
jinja2==3.1.3
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -356,8 +352,6 @@ rfc3986==2.0.0
# via twine
rich==13.7.1
# via twine
secretstorage==3.3.3
# via keyring
six==1.16.0
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -449,4 +443,5 @@ zipp==3.18.1
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
setuptools==69.2.0
# via sphinx
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
9 changes: 8 additions & 1 deletion 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 @@ -373,3 +374,9 @@ wcwidth==0.2.13
# via
# -r requirements/test.txt
# prompt-toolkit
wheel==0.43.0
# via -r requirements/quality.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.1.0
# via -r requirements/quality.in
3 changes: 2 additions & 1 deletion 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
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}-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 171c818

Please sign in to comment.