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 python311 support #233

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
6 changes: 3 additions & 3 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, django40]
python-version: ['3.8', '3.11']
toxenv: [quality, docs, pii_check, django42]

steps:
- uses: actions/checkout@v4
Expand All @@ -37,7 +37,7 @@ jobs:
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
if: matrix.python-version == '3.8' && matrix.toxenv == 'django42'
uses: codecov/codecov-action@v3
with:
flags: unittests
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Change Log
Unreleased
**********

[5.7.0] - 2024-03-22
********************
Changed
=======
* Dropped Support for Django 3.2, Django 4.0 and Django 4.1
* Added Support for Python 3.12

[5.6.0] - 2024-01-25
********************
Changed
Expand Down
2 changes: 1 addition & 1 deletion edx_event_bus_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
from edx_event_bus_kafka.internal.consumer import KafkaEventConsumer
from edx_event_bus_kafka.internal.producer import KafkaEventProducer, create_producer

__version__ = '5.6.0'
__version__ = '5.7.0'
6 changes: 3 additions & 3 deletions edx_event_bus_kafka/internal/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _consume_indefinitely(self):
consecutive_errors = 0

self._add_message_monitoring(run_context=run_context, message=msg)
except Exception as e: # pylint: disable=broad-except
except Exception as e:
consecutive_errors += 1
self.record_event_consuming_error(run_context, e, msg)
# Kill the infinite loop if the error is fatal for the consumer
Expand Down Expand Up @@ -515,7 +515,7 @@ def _log_message_received(self, msg):
f'offset={msg.offset()}, message_id={message_id}, key={msg.key()}, '
f'event_timestamp_ms={timestamp_info}'
)
except Exception as e: # pragma: no cover pylint: disable=broad-except
except Exception as e: # pragma: no cover
# Use this to fix any bugs in what should be benign logging code
set_custom_attribute('kafka_logging_error', repr(e))

Expand Down Expand Up @@ -603,7 +603,7 @@ def _add_message_monitoring(self, run_context, message, error=None):
# .. custom_attribute_description: Boolean describing if the error is retriable.
set_custom_attribute('kafka_error_retriable', kafka_error.retriable())

except Exception as e: # pragma: no cover pylint: disable=broad-except
except Exception as e: # pragma: no cover
# Use this to fix any bugs in what should be benign monitoring code
set_custom_attribute('kafka_monitoring_error', repr(e))

Expand Down
2 changes: 1 addition & 1 deletion edx_event_bus_kafka/internal/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def send(
# would never get a delivery callback. That's why there's also a thread calling
# poll(0) on a regular interval (see `poll_indefinitely`).
self.producer.poll(0)
except Exception as e: # pylint: disable=broad-except
except Exception as e:
# Errors caused by the produce call should be handled by the on_delivery callback.
# Here we might expect serialization errors, or any errors from preparing to produce.
record_producing_error(e, context)
Expand Down
2 changes: 1 addition & 1 deletion edx_event_bus_kafka/management/commands/produce_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@
event_metadata=EventsMetadata(event_type=event_type),
)
producer.prepare_for_shutdown() # otherwise command may exit before delivery is complete
except Exception: # pylint: disable=broad-except
except Exception:

Check warning on line 67 in edx_event_bus_kafka/management/commands/produce_event.py

View check run for this annotation

Codecov / codecov/patch

edx_event_bus_kafka/management/commands/produce_event.py#L67

Added line #L67 was not covered by tests
logger.exception("Error producing Kafka event")
20 changes: 11 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
#
# make upgrade
#
asgiref==3.7.2
asgiref==3.8.0
# via django
attrs==23.2.0
# via openedx-events
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
cffi==1.16.0
# via pynacl
click==8.1.7
# via
# code-annotations
# edx-django-utils
code-annotations==1.6.0
code-annotations==1.7.0
# via edx-toggles
django==3.2.24
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
Expand All @@ -33,7 +37,7 @@ django-waffle==4.1.0
# via
# edx-django-utils
# edx-toggles
edx-django-utils==5.10.1
edx-django-utils==5.11.0
# via
# -r requirements/base.in
# edx-toggles
Expand All @@ -48,7 +52,7 @@ jinja2==3.1.3
# via code-annotations
markupsafe==2.1.5
# via jinja2
newrelic==9.6.0
newrelic==9.7.1
# via edx-django-utils
openedx-events==9.5.2
# via -r requirements/base.in
Expand All @@ -64,20 +68,18 @@ pynacl==1.5.0
# via edx-django-utils
python-slugify==8.0.4
# via code-annotations
pytz==2024.1
# via django
pyyaml==6.0.1
# via code-annotations
sqlparse==0.4.4
# via django
stevedore==5.1.0
stevedore==5.2.0
# via
# code-annotations
# edx-django-utils
# edx-opaque-keys
text-unidecode==1.3
# via python-slugify
typing-extensions==4.9.0
typing-extensions==4.10.0
# via
# asgiref
# edx-opaque-keys
8 changes: 4 additions & 4 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# make upgrade
#
cachetools==5.3.2
cachetools==5.3.3
# via tox
chardet==5.2.0
# via tox
Expand All @@ -16,7 +16,7 @@ filelock==3.13.1
# via
# tox
# virtualenv
packaging==23.2
packaging==24.0
# via
# pyproject-api
# tox
Expand All @@ -32,7 +32,7 @@ tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.13.0
tox==4.14.1
# via -r requirements/ci.in
virtualenv==20.25.0
virtualenv==20.25.1
# via tox
3 changes: 3 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

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

# For python greater than or equal to 3.9 backports.zoneinfo causing failures
backports.zoneinfo; python_version<'3.9'
Loading
Loading