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!: drop support for python3.8 #441

Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.11', '3.12']
python-version: ['3.12']
toxenv: [docs, quality, django42]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install pip
run: pip install -r requirements/pip.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ lib64

# Installer logs
pip-log.txt
venv

# Unit test / coverage reports
.cache/
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ Change Log

.. There should always be an "Unreleased" section for changes pending release.

[6.0.0] - 2024-10-09
---------------------
Added
~~~~~
* Added support for python3.12
* Dropped support for python<3.12 versions

[5.16.0] - 2024-09-27
---------------------
Added
Expand All @@ -22,7 +29,6 @@ Changed
~~~~~~~
* Renamed ``CachedCustomMonitoringMiddleware`` to ``MonitoringSupportMiddleware`` and deprecated the old name. It will be removed in a future release.


[5.15.0] - 2024-07-29
---------------------
Added
Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
EdX utilities for Django Application development..
"""

__version__ = "5.16.0"
__version__ = "6.0.0"

default_app_config = (
"edx_django_utils.apps.EdxDjangoUtilsConfig"
Expand Down
3 changes: 2 additions & 1 deletion edx_django_utils/ip/internal/tests/test_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def test_get_client_ips_via_xff(self, xff, remote_addr, expected_strs):
# Warning: Bad IP address
('Some-Thing', 0, {'HTTP_SOME_THING': 'XXXXXXXXX'}, None, "invalid IP"),
)
def test_get_trusted_header_ip(self, header_name, index, add_meta, expected, warning_substr):
def test_get_trusted_header_ip( # pylint: disable=too-many-positional-arguments
self, header_name, index, add_meta, expected, warning_substr):
self.request.META.update(add_meta)

with warning_messages() as caught_warnings:
Expand Down
4 changes: 2 additions & 2 deletions edx_django_utils/monitoring/internal/code_owner/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _get_module_from_request_path(self, request):
# TODO: Replace ImportError with ModuleNotFoundError when Python 3.5 support is dropped.
except (ImportError, Resolver404) as e:
return None, str(e)
except Exception as e: # pylint: disable=broad-except; #pragma: no cover
except Exception as e: # pragma: no cover
# will remove broad exceptions after ensuring all proper cases are covered
set_custom_attribute('deprecated_broad_except__get_module_from_request_path', e.__class__)
return None, str(e)
Expand All @@ -131,7 +131,7 @@ def _get_module_from_current_transaction(self):
module = transaction_name.split(':')[0]
set_custom_attribute('code_owner_transaction_name', transaction_name)
return module, None
except Exception as e: # pylint: disable=broad-except
except Exception as e:
# will remove broad exceptions after ensuring all proper cases are covered
set_custom_attribute('deprecated_broad_except___get_module_from_current_transaction', e.__class__)
return None, str(e)
2 changes: 1 addition & 1 deletion edx_django_utils/monitoring/internal/code_owner/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _get_catch_all_code_owner():
try:
code_owner = get_code_owner_from_module('*')
return code_owner
except Exception as e: # pylint: disable=broad-except; #pragma: no cover
except Exception as e: # pragma: no cover
# will remove broad exceptions after ensuring all proper cases are covered
set_custom_attribute('deprecated_broad_except___get_module_from_current_transaction', e.__class__)
return None
Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/monitoring/internal/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def process_response(self, request, response):
self._batch_report()
return response

def process_exception(self, request, exception): # pylint: disable=W0613
def process_exception(self, request, exception):
"""
Django middleware handler to process an exception
"""
Expand Down
13 changes: 7 additions & 6 deletions edx_django_utils/monitoring/tests/code_owner/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_code_owner_path_mapping_with_catch_all(
),
)
@ddt.unpack
def test_code_owner_transaction_mapping_hits_and_misses(
def test_code_owner_transaction_mapping_hits_and_misses( # pylint: disable=too-many-positional-arguments
self, path_module, transaction_name, expected_owner, mock_newrelic_agent, mock_set_custom_attribute, _
):
mock_newrelic_agent.current_transaction().name = transaction_name
Expand Down Expand Up @@ -199,7 +199,7 @@ def test_code_owner_transaction_mapping_hits_and_misses(
),
)
@ddt.unpack
def test_code_owner_transaction_mapping_with_catch_all(
def test_code_owner_transaction_mapping_with_catch_all( # pylint: disable=too-many-positional-arguments
self, path_module, transaction_name, expected_owner, mock_newrelic_agent, mock_set_custom_attribute, _
):
mock_newrelic_agent.current_transaction().name = transaction_name
Expand Down Expand Up @@ -288,10 +288,11 @@ def test_load_config_with_invalid_dict(self):
with self.assertRaises(TypeError):
self.middleware(request)

def _assert_code_owner_custom_attributes(self, mock_set_custom_attribute, expected_code_owner=None,
path_module=None, has_path_error=False,
transaction_name=None, has_transaction_error=False,
check_theme_and_squad=False):
def _assert_code_owner_custom_attributes( # pylint: disable=too-many-positional-arguments
self, mock_set_custom_attribute, expected_code_owner=None,
path_module=None, has_path_error=False,
transaction_name=None, has_transaction_error=False,
check_theme_and_squad=False):
""" Performs a set of assertions around having set the proper custom attributes. """
call_list = []
if expected_code_owner:
Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/plugins/plugin_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_plugins_view_context(project_type, view_name, existing_context=None):
for (context_function, plugin_name) in context_functions:
try:
plugin_context = context_function(existing_context)
except Exception as exc: # pylint: disable=broad-except
except Exception as exc:
# We're catching this because we don't want the core to blow up when a
# plugin is broken. This exception will probably need some sort of
# monitoring hooked up to it to make sure that these errors don't go
Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/user/management/commands/manage_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _handle_remove(self, username, email):
user.delete()

@transaction.atomic
def handle( # pylint: disable=arguments-differ
def handle( # pylint: disable=too-many-positional-arguments, arguments-differ
self, username, email, is_remove, is_staff, is_superuser, groups,
unusable_password, initial_password_hash, *args, **options
):
Expand Down
24 changes: 9 additions & 15 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
#
asgiref==3.8.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
cffi==1.16.0
cffi==1.17.1
# via pynacl
click==8.1.7
# via -r requirements/base.in
django==4.2.11
django==4.2.16
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
Expand All @@ -24,19 +20,17 @@ django-crum==0.7.9
# via -r requirements/base.in
django-waffle==4.1.0
# via -r requirements/base.in
newrelic==9.8.0
newrelic==10.0.0
# via -r requirements/base.in
pbr==6.0.0
pbr==6.1.0
# via stevedore
psutil==5.9.8
psutil==6.0.0
# via -r requirements/base.in
pycparser==2.21
pycparser==2.22
# via cffi
pynacl==1.5.0
# via -r requirements/base.in
sqlparse==0.4.4
sqlparse==0.5.1
# via django
stevedore==5.2.0
stevedore==5.3.0
# via -r requirements/base.in
typing-extensions==4.10.0
# via asgiref
22 changes: 9 additions & 13 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
#
cachetools==5.3.3
cachetools==5.5.0
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
filelock==3.13.3
filelock==3.16.1
# via
# tox
# virtualenv
packaging==24.0
packaging==24.1
# via
# pyproject-api
# tox
platformdirs==4.2.0
platformdirs==4.3.6
# via
# tox
# virtualenv
pluggy==1.4.0
pluggy==1.5.0
# via tox
pyproject-api==1.6.1
pyproject-api==1.8.0
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.14.2
tox==4.21.1
# via -r requirements/ci.in
virtualenv==20.25.1
virtualenv==20.26.6
# via tox
5 changes: 1 addition & 4 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@

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

# diff-cover latest requires (pluggy>=0.13.1,<0.14.0)
# which conflicts with pytest(pluggy>=0.12,<2.0.0) and tox(pluggy>0.12) both of these fetch pluggy==1.0.0
diff-cover<6.2.2


# greater version failing docs build
sphinx==4.2.0

# version 1.0.0 requires docutils >0.19 but [email protected] needs docutils<0.18
doc8<1.0.0

Expand Down
Loading