Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add python 3.12 support #258

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.11']
python-version: ['3.11', '3.12']
toxenv: ["django42", "quality", "docs"]

steps:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Change Log
Unreleased
----------

[1.14.0] - 2025-02-12
---------------------

Changed
~~~~~~~

* Added support for Python 3.12

[1.13.0] - 2025-01-31
---------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/django-plugins-and-filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ file. The dictionary has the following structure:
Create pipeline steps
*********************

In your own plugin, you can create your own :term:`pipeline steps<Pipeline Steps>` by inheriting from ``PipelineStep`` and implementing the
``run_filter`` method. You can find examples of :term:`pipeline steps<Pipeline Steps>` in the ``openedx-filters-samples`` repository. See :doc:`/quickstarts/index` for more details.
In your own plugin, you can create your own :term:`pipeline steps<Pipeline Step>` by inheriting from ``PipelineStep`` and implementing the
``run_filter`` method. You can find examples of :term:`pipeline steps<Pipeline Step>` in the ``openedx-filters-samples`` repository. See :doc:`/quickstarts/index` for more details.
2 changes: 1 addition & 1 deletion docs/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A filter has multiple components that are used to define, execute and handle fil
Filter Configuration
The filter configuration is a dictionary that defines the pipeline settings for a filter. Each filter type has its own configuration, which includes settings like whether errors should fail silently or propagate, and the sequence of pipeline steps. Configurations specify the filter type, error-handling preferences, and a list of module paths for each pipeline step to be executed. E.g., the configuration for the `CourseEnrollmentStarted filter`_ might include settings like ``fail_silently: False`` and ``['my_plugin.filters.StopEnrollmentIfNotValidEmail']`` as its pipeline steps. See the :doc:`/decisions/0002-hooks-filter-config-location` for more details on the configuration format.

This glossary provides a high-level overview of the key concepts and components of the Open edX Filters library. Understanding these terms will help you implement filters in your application and leverage the filter tooling to control the flow of your application based on specific conditions. For a better illustration of these concepts, refer to the :doc:`/how-tos/using-filters` guide.
This glossary provides a high-level overview of the key concepts and components of the Open edX Filters library. Understanding these terms will help you implement filters in your application and leverage the filter tooling to control the flow of your application based on specific conditions. For a better illustration of these concepts, refer to the :doc:`/how-tos/create-a-pipeline-step` guide.

.. _Python Social Auth accumulative pipeline: https://python-social-auth.readthedocs.io/en/latest/pipeline.html
.. _PipelineStep: https://github.com/openedx/openedx-filters/blob/main/openedx_filters/filters.py#L10
Expand Down
2 changes: 1 addition & 1 deletion openedx_filters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""
from openedx_filters.filters import *

__version__ = "1.13.0"
__version__ = "1.14.0"
26 changes: 13 additions & 13 deletions openedx_filters/learning/tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_halt_certificate_process(self, CertificateException, attributes):
"""
exception = CertificateException(message="You can't generate certificate", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -216,7 +216,7 @@ def test_halt_student_auth_process(self, auth_exception, attributes):
"""
exception = auth_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -276,7 +276,7 @@ def test_halt_enrollment_process(self, enrollment_exception, attributes):
"""
exception = enrollment_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_course_enrollments_requested(self):
"""
Expand Down Expand Up @@ -307,7 +307,7 @@ def test_halt_queryset_request(self, request_exception, attributes):
"""
exception = request_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


@ddt
Expand Down Expand Up @@ -378,7 +378,7 @@ def test_halt_dashboard_render(self, dashboard_exception, attributes):
"""
exception = dashboard_exception(message="You can't access the dashboard", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

@data(
(CourseAboutRenderStarted.RedirectToPage, {"redirect_to": "custom-course-about.html"}),
Expand All @@ -401,7 +401,7 @@ def test_halt_course_about_render(self, course_about_exception, attributes):
"""
exception = course_about_exception(message="You can't access the course about", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_verticalblock_child_render_started(self):
"""
Expand Down Expand Up @@ -441,7 +441,7 @@ def test_halt_vertical_child_block_render(self, block_render_exception, attribut
"""
exception = block_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_vertical_block_render_completed(self):
"""
Expand Down Expand Up @@ -482,7 +482,7 @@ def test_halt_vertical_block_render(self, render_exception, attributes):
"""
exception = render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_xblock_render_started(self):
"""
Expand Down Expand Up @@ -524,7 +524,7 @@ def test_halt_xblock_render(self, xblock_render_exception, attributes):
"""
exception = xblock_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

@data(
(
Expand All @@ -544,7 +544,7 @@ def test_halt_xblock_render_custom_response(self, xblock_render_exception, attri
"""
exception = xblock_render_exception(**attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_account_settings_render_started(self):
"""
Expand Down Expand Up @@ -577,7 +577,7 @@ def test_halt_account_rendering_process(self, AccountSettingsException, attribut
"""
exception = AccountSettingsException(message="You can't access this page", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_instructor_dashboard_render_started(self):
"""
Expand Down Expand Up @@ -612,7 +612,7 @@ def test_halt_instructor_dashboard_render(self, dashboard_exception, attributes)
"""
exception = dashboard_exception(message="You can't access the dashboard", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())

def test_ora_submission_view_render_started(self):
"""
Expand Down Expand Up @@ -642,7 +642,7 @@ def test_halt_ora_submission_view_render(self, dashboard_exception, attributes):
"""
exception = dashboard_exception(message="You can't access the view", **attributes)

self.assertDictContainsSubset(attributes, exception.__dict__)
self.assertLessEqual(attributes.items(), exception.__dict__.items())


class TestCohortFilters(TestCase):
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

django
edx-opaque-keys[django]
setuptools
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More context on this change: openedx/edx-cookiecutters@293ae2f

9 changes: 6 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
#
asgiref==3.8.1
# via django
django==4.2.18
django==4.2.19
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
dnspython==2.7.0
# via pymongo
edx-opaque-keys[django]==2.11.0
# via -r requirements/base.in
pbr==6.1.0
pbr==6.1.1
# via stevedore
pymongo==4.11
pymongo==4.11.1
# via edx-opaque-keys
sqlparse==0.5.3
# via django
stevedore==5.4.0
# via edx-opaque-keys
typing-extensions==4.12.2
# via edx-opaque-keys

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ pyproject-api==1.9.0
# via tox
tox==4.24.1
# via -r requirements/ci.in
virtualenv==20.29.1
virtualenv==20.29.2
# via tox
20 changes: 10 additions & 10 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ colorama==0.4.6
# via
# -r requirements/ci.txt
# tox
coverage[toml]==7.6.10
coverage[toml]==7.6.12
# via
# -r requirements/quality.txt
# pytest-cov
cryptography==44.0.0
cryptography==44.0.1
# via
# -r requirements/quality.txt
# secretstorage
Expand All @@ -83,15 +83,15 @@ distlib==0.3.9
# via
# -r requirements/ci.txt
# virtualenv
django==4.2.18
django==4.2.19
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/quality.txt
# django-stubs
# django-stubs-ext
django-stubs==5.1.2
django-stubs==5.1.3
# via -r requirements/quality.txt
django-stubs-ext==5.1.2
django-stubs-ext==5.1.3
# via
# -r requirements/quality.txt
# django-stubs
Expand Down Expand Up @@ -179,7 +179,7 @@ more-itertools==10.6.0
# -r requirements/quality.txt
# jaraco-classes
# jaraco-functools
mypy==1.14.1
mypy==1.15.0
# via -r requirements/quality.txt
mypy-extensions==1.0.0
# via
Expand All @@ -199,7 +199,7 @@ packaging==24.2
# pytest
# tox
# twine
pbr==6.1.0
pbr==6.1.1
# via
# -r requirements/quality.txt
# stevedore
Expand Down Expand Up @@ -253,7 +253,7 @@ pylint-plugin-utils==0.8.2
# -r requirements/quality.txt
# pylint-celery
# pylint-django
pymongo==4.11
pymongo==4.11.1
# via
# -r requirements/quality.txt
# edx-opaque-keys
Expand All @@ -273,7 +273,7 @@ pytest==8.3.4
# pytest-django
pytest-cov==6.0.0
# via -r requirements/quality.txt
pytest-django==4.9.0
pytest-django==4.10.0
# via -r requirements/quality.txt
python-slugify==8.0.4
# via
Expand Down Expand Up @@ -355,7 +355,7 @@ urllib3==2.2.3
# -r requirements/quality.txt
# requests
# twine
virtualenv==20.29.1
virtualenv==20.29.2
# via
# -r requirements/ci.txt
# tox
Expand Down
23 changes: 13 additions & 10 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ babel==2.17.0
# sphinx
backports-tarfile==1.2.0
# via jaraco-context
beautifulsoup4==4.13.1
beautifulsoup4==4.13.3
# via pydata-sphinx-theme
build==1.2.2.post1
# via -r requirements/doc.in
Expand All @@ -42,23 +42,23 @@ code-annotations==2.2.0
# via -r requirements/test.txt
colorama==0.4.6
# via sphinx-autobuild
coverage[toml]==7.6.10
coverage[toml]==7.6.12
# via
# -r requirements/test.txt
# pytest-cov
cryptography==44.0.0
cryptography==44.0.1
# via secretstorage
ddt==1.7.2
# via -r requirements/test.txt
django==4.2.18
django==4.2.19
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/test.txt
# django-stubs
# django-stubs-ext
django-stubs==5.1.2
django-stubs==5.1.3
# via -r requirements/test.txt
django-stubs-ext==5.1.2
django-stubs-ext==5.1.3
# via
# -r requirements/test.txt
# django-stubs
Expand Down Expand Up @@ -122,7 +122,7 @@ more-itertools==10.6.0
# via
# jaraco-classes
# jaraco-functools
mypy==1.14.1
mypy==1.15.0
# via -r requirements/test.txt
mypy-extensions==1.0.0
# via
Expand All @@ -137,7 +137,7 @@ packaging==24.2
# pytest
# sphinx
# twine
pbr==6.1.0
pbr==6.1.1
# via
# -r requirements/test.txt
# stevedore
Expand All @@ -157,7 +157,7 @@ pygments==2.19.1
# readme-renderer
# rich
# sphinx
pymongo==4.11
pymongo==4.11.1
# via
# -r requirements/test.txt
# edx-opaque-keys
Expand All @@ -170,7 +170,7 @@ pytest==8.3.4
# pytest-django
pytest-cov==6.0.0
# via -r requirements/test.txt
pytest-django==4.9.0
pytest-django==4.10.0
# via -r requirements/test.txt
python-slugify==8.0.4
# via
Expand Down Expand Up @@ -281,3 +281,6 @@ websockets==14.2
# via sphinx-autobuild
zipp==3.21.0
# via importlib-metadata

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