Skip to content

Commit

Permalink
chore: add python 3.12 support (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV authored Feb 13, 2025
1 parent 26d1d3b commit b811a5d
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 53 deletions.
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 @@ -16,6 +16,14 @@ Change Log
Unreleased
__________

[9.18.1] - 2025-02-13
---------------------

Changed
~~~~~~~

* Added support for Python 3.12

[9.18.0] - 2025-02-06
---------------------

Expand Down
2 changes: 1 addition & 1 deletion openedx_events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
more information about the project.
"""

__version__ = "9.18.0"
__version__ = "9.18.1"
4 changes: 2 additions & 2 deletions openedx_events/event_bus/avro/tests/test_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def test_evolution_is_forward_compatible(self):

# get stored schema
schema_filename = f"{os.path.dirname(os.path.abspath(__file__))}/schemas/" \
f"{signal.event_type.replace('.','+')}_schema.avsc"
f"{signal.event_type.replace('.', '+')}_schema.avsc"
try:
stored_schema = load_schema(schema_filename)
except SchemaRepositoryError: # pragma: no cover
Expand Down Expand Up @@ -243,7 +243,7 @@ def test_evolution_is_backward_compatible(self):

# get stored schema
schema_filename = f"{os.path.dirname(os.path.abspath(__file__))}/schemas/" \
f"{signal.event_type.replace('.','+')}_schema.avsc"
f"{signal.event_type.replace('.', '+')}_schema.avsc"
try:
old_schema = load_schema(schema_filename)
except SchemaRepositoryError: # pragma: no cover
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def handle(self, *args, **options):
continue
serializer = AvroSignalSerializer(signal)
schema_dict = serializer.schema
filename = f"{signal.event_type.replace('.','+')}_schema.avsc"
filename = f"{signal.event_type.replace('.', '+')}_schema.avsc"
root_path = import_module('openedx_events').__path__[0]
folder_path = f"{root_path}/event_bus/avro/tests/schemas"
full_file_name = f"{folder_path}/{filename}"
Expand Down
2 changes: 1 addition & 1 deletion openedx_events/tests/test_generate_avro_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_command_warns_if_schema_exists(self):
@patch('os.path.exists', lambda path: path == TestGenerateAvroCommand.folder_path)
def test_generate_all(self):
load_all_signals()
expected_files = [f"{TestGenerateAvroCommand.folder_path}/{signal.event_type.replace('.','+')}_schema.avsc"
expected_files = [f"{TestGenerateAvroCommand.folder_path}/{signal.event_type.replace('.', '+')}_schema.avsc"
for signal in OpenEdxPublicSignal.all_events() if signal.event_type
not in KNOWN_UNSERIALIZABLE_SIGNALS]
with patch("builtins.open", mock_open()) as mock_file:
Expand Down
3 changes: 2 additions & 1 deletion openedx_events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class ResponsePrettyPrinter(PrettyPrinter):
This class pretty-prints the response of common Django Signals.
"""

def _format(self, obj, stream, indent, allowance, context, level): # pylint: disable=arguments-renamed
# pylint: disable-next=arguments-renamed, too-many-positional-arguments
def _format(self, obj, stream, indent, allowance, context, level):
"""
Override format method exposing more information about functions/exceptions.
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ attrs
fastavro
edx-opaque-keys[django]
edx-ccx-keys
setuptools
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ psutil==6.1.1
# via edx-django-utils
pycparser==2.22
# via cffi
pymongo==4.11
pymongo==4.11.1
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
Expand Down
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
5 changes: 0 additions & 5 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@

# Common constraints for openedx repos
-c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt

# Temporary solution since this version raises RecursionError for test_generate_avro_schemas.py
# This should be removed once the issue is fixed with a new astroid release or with a test_generate_avro_schemas.py
# module refactor.
astroid<3.0.0
27 changes: 9 additions & 18 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ asgiref==3.8.1
# via
# -r requirements/quality.txt
# django
astroid==2.15.8
astroid==3.3.8
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
# pylint
# pylint-celery
Expand Down Expand Up @@ -67,11 +66,11 @@ colorama==0.4.6
# via
# -r requirements/ci.txt
# tox
coverage[toml]==7.6.11
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 Down Expand Up @@ -143,7 +142,7 @@ iniconfig==2.0.0
# via
# -r requirements/quality.txt
# pytest
isort==5.13.2
isort==6.0.0
# via
# -r requirements/quality.txt
# pylint
Expand Down Expand Up @@ -173,10 +172,6 @@ keyring==25.6.0
# via
# -r requirements/quality.txt
# twine
lazy-object-proxy==1.10.0
# via
# -r requirements/quality.txt
# astroid
markdown-it-py==3.0.0
# via
# -r requirements/quality.txt
Expand Down Expand Up @@ -254,7 +249,7 @@ pygments==2.19.1
# diff-cover
# readme-renderer
# rich
pylint==2.17.7
pylint==3.3.4
# via
# -r requirements/quality.txt
# edx-lint
Expand All @@ -265,7 +260,7 @@ pylint-celery==0.3
# via
# -r requirements/quality.txt
# edx-lint
pylint-django==2.5.5
pylint-django==2.6.1
# via
# -r requirements/quality.txt
# edx-lint
Expand All @@ -274,7 +269,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 @@ -298,7 +293,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 @@ -375,18 +370,14 @@ urllib3==2.2.3
# -r requirements/quality.txt
# requests
# twine
virtualenv==20.29.1
virtualenv==20.29.2
# via
# -r requirements/ci.txt
# tox
wheel==0.45.1
# via
# -r requirements/pip-tools.txt
# pip-tools
wrapt==1.17.2
# via
# -r requirements/quality.txt
# astroid
zipp==3.21.0
# via
# -r requirements/quality.txt
Expand Down
8 changes: 4 additions & 4 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ code-annotations==2.2.0
# via -r requirements/test.txt
colorama==0.4.6
# via sphinx-autobuild
coverage[toml]==7.6.11
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
Expand Down Expand Up @@ -181,7 +181,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 @@ -198,7 +198,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
21 changes: 8 additions & 13 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ asgiref==3.8.1
# via
# -r requirements/test.txt
# django
astroid==2.15.8
astroid==3.3.8
# via
# -c requirements/constraints.txt
# pylint
# pylint-celery
attrs==25.1.0
Expand Down Expand Up @@ -39,11 +38,11 @@ code-annotations==2.2.0
# via
# -r requirements/test.txt
# edx-lint
coverage[toml]==7.6.11
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
Expand Down Expand Up @@ -92,7 +91,7 @@ iniconfig==2.0.0
# via
# -r requirements/test.txt
# pytest
isort==5.13.2
isort==6.0.0
# via
# -r requirements/quality.in
# pylint
Expand All @@ -112,8 +111,6 @@ jinja2==3.1.5
# code-annotations
keyring==25.6.0
# via twine
lazy-object-proxy==1.10.0
# via astroid
markdown-it-py==3.0.0
# via rich
markupsafe==3.0.2
Expand Down Expand Up @@ -165,21 +162,21 @@ pygments==2.19.1
# via
# readme-renderer
# rich
pylint==2.17.7
pylint==3.3.4
# via
# edx-lint
# pylint-celery
# pylint-django
# pylint-plugin-utils
pylint-celery==0.3
# via edx-lint
pylint-django==2.5.5
pylint-django==2.6.1
# via edx-lint
pylint-plugin-utils==0.8.2
# via
# pylint-celery
# pylint-django
pymongo==4.11
pymongo==4.11.1
# via
# -r requirements/test.txt
# edx-opaque-keys
Expand All @@ -194,7 +191,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 @@ -253,8 +250,6 @@ urllib3==2.2.3
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# requests
# twine
wrapt==1.17.2
# via astroid
zipp==3.21.0
# via importlib-metadata

Expand Down
6 changes: 3 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ click==8.1.8
# edx-django-utils
code-annotations==2.2.0
# via -r requirements/test.in
coverage[toml]==7.6.11
coverage[toml]==7.6.12
# via pytest-cov
ddt==1.7.2
# via -r requirements/test.in
Expand Down Expand Up @@ -79,7 +79,7 @@ pycparser==2.22
# via
# -r requirements/base.txt
# cffi
pymongo==4.11
pymongo==4.11.1
# via
# -r requirements/base.txt
# edx-opaque-keys
Expand All @@ -93,7 +93,7 @@ pytest==8.3.4
# pytest-django
pytest-cov==6.0.0
# via -r requirements/test.in
pytest-django==4.9.0
pytest-django==4.10.0
# via -r requirements/test.in
python-slugify==8.0.4
# via code-annotations
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,6 @@ def is_requirement(line):
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{311}-django{42}, quality, docs
envlist = py{311, 312}-django{42}, quality, docs

[doc8]
ignore = D001
Expand Down

0 comments on commit b811a5d

Please sign in to comment.