Skip to content

Commit b4c8425

Browse files
feat!: drop support for python<3.12 versions (#441)
1 parent 43db7f8 commit b4c8425

File tree

23 files changed

+227
-417
lines changed

23 files changed

+227
-417
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
os: [ubuntu-latest]
19-
python-version: ['3.8', '3.11', '3.12']
19+
python-version: ['3.12']
2020
toxenv: [docs, quality, django42]
2121

2222
steps:

.github/workflows/pypi-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: setup python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: 3.8
19+
python-version: 3.12
2020

2121
- name: Install pip
2222
run: pip install -r requirements/pip.txt

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ lib64
2222

2323
# Installer logs
2424
pip-log.txt
25+
venv
2526

2627
# Unit test / coverage reports
2728
.cache/

CHANGELOG.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ Change Log
1111

1212
.. There should always be an "Unreleased" section for changes pending release.
1313
14+
[6.0.0] - 2024-10-09
15+
---------------------
16+
Added
17+
~~~~~
18+
* Added support for python3.12
19+
* Dropped support for python<3.12 versions
20+
1421
[5.16.0] - 2024-09-27
1522
---------------------
1623
Added
@@ -22,7 +29,6 @@ Changed
2229
~~~~~~~
2330
* Renamed ``CachedCustomMonitoringMiddleware`` to ``MonitoringSupportMiddleware`` and deprecated the old name. It will be removed in a future release.
2431

25-
2632
[5.15.0] - 2024-07-29
2733
---------------------
2834
Added

edx_django_utils/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
EdX utilities for Django Application development..
33
"""
44

5-
__version__ = "5.16.0"
5+
__version__ = "6.0.0"
66

77
default_app_config = (
88
"edx_django_utils.apps.EdxDjangoUtilsConfig"

edx_django_utils/ip/internal/tests/test_ip.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def test_get_client_ips_via_xff(self, xff, remote_addr, expected_strs):
150150
# Warning: Bad IP address
151151
('Some-Thing', 0, {'HTTP_SOME_THING': 'XXXXXXXXX'}, None, "invalid IP"),
152152
)
153-
def test_get_trusted_header_ip(self, header_name, index, add_meta, expected, warning_substr):
153+
def test_get_trusted_header_ip( # pylint: disable=too-many-positional-arguments
154+
self, header_name, index, add_meta, expected, warning_substr):
154155
self.request.META.update(add_meta)
155156

156157
with warning_messages() as caught_warnings:

edx_django_utils/monitoring/internal/code_owner/middleware.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _get_module_from_request_path(self, request):
107107
# TODO: Replace ImportError with ModuleNotFoundError when Python 3.5 support is dropped.
108108
except (ImportError, Resolver404) as e:
109109
return None, str(e)
110-
except Exception as e: # pylint: disable=broad-except; #pragma: no cover
110+
except Exception as e: # pragma: no cover
111111
# will remove broad exceptions after ensuring all proper cases are covered
112112
set_custom_attribute('deprecated_broad_except__get_module_from_request_path', e.__class__)
113113
return None, str(e)
@@ -131,7 +131,7 @@ def _get_module_from_current_transaction(self):
131131
module = transaction_name.split(':')[0]
132132
set_custom_attribute('code_owner_transaction_name', transaction_name)
133133
return module, None
134-
except Exception as e: # pylint: disable=broad-except
134+
except Exception as e:
135135
# will remove broad exceptions after ensuring all proper cases are covered
136136
set_custom_attribute('deprecated_broad_except___get_module_from_current_transaction', e.__class__)
137137
return None, str(e)

edx_django_utils/monitoring/internal/code_owner/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _get_catch_all_code_owner():
121121
try:
122122
code_owner = get_code_owner_from_module('*')
123123
return code_owner
124-
except Exception as e: # pylint: disable=broad-except; #pragma: no cover
124+
except Exception as e: # pragma: no cover
125125
# will remove broad exceptions after ensuring all proper cases are covered
126126
set_custom_attribute('deprecated_broad_except___get_module_from_current_transaction', e.__class__)
127127
return None

edx_django_utils/monitoring/internal/middleware.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def process_response(self, request, response):
150150
self._batch_report()
151151
return response
152152

153-
def process_exception(self, request, exception): # pylint: disable=W0613
153+
def process_exception(self, request, exception):
154154
"""
155155
Django middleware handler to process an exception
156156
"""

edx_django_utils/monitoring/tests/code_owner/test_middleware.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def test_code_owner_path_mapping_with_catch_all(
152152
),
153153
)
154154
@ddt.unpack
155-
def test_code_owner_transaction_mapping_hits_and_misses(
155+
def test_code_owner_transaction_mapping_hits_and_misses( # pylint: disable=too-many-positional-arguments
156156
self, path_module, transaction_name, expected_owner, mock_newrelic_agent, mock_set_custom_attribute, _
157157
):
158158
mock_newrelic_agent.current_transaction().name = transaction_name
@@ -199,7 +199,7 @@ def test_code_owner_transaction_mapping_hits_and_misses(
199199
),
200200
)
201201
@ddt.unpack
202-
def test_code_owner_transaction_mapping_with_catch_all(
202+
def test_code_owner_transaction_mapping_with_catch_all( # pylint: disable=too-many-positional-arguments
203203
self, path_module, transaction_name, expected_owner, mock_newrelic_agent, mock_set_custom_attribute, _
204204
):
205205
mock_newrelic_agent.current_transaction().name = transaction_name
@@ -288,10 +288,11 @@ def test_load_config_with_invalid_dict(self):
288288
with self.assertRaises(TypeError):
289289
self.middleware(request)
290290

291-
def _assert_code_owner_custom_attributes(self, mock_set_custom_attribute, expected_code_owner=None,
292-
path_module=None, has_path_error=False,
293-
transaction_name=None, has_transaction_error=False,
294-
check_theme_and_squad=False):
291+
def _assert_code_owner_custom_attributes( # pylint: disable=too-many-positional-arguments
292+
self, mock_set_custom_attribute, expected_code_owner=None,
293+
path_module=None, has_path_error=False,
294+
transaction_name=None, has_transaction_error=False,
295+
check_theme_and_squad=False):
295296
""" Performs a set of assertions around having set the proper custom attributes. """
296297
call_list = []
297298
if expected_code_owner:

edx_django_utils/plugins/plugin_contexts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_plugins_view_context(project_type, view_name, existing_context=None):
4040
for (context_function, plugin_name) in context_functions:
4141
try:
4242
plugin_context = context_function(existing_context)
43-
except Exception as exc: # pylint: disable=broad-except
43+
except Exception as exc:
4444
# We're catching this because we don't want the core to blow up when a
4545
# plugin is broken. This exception will probably need some sort of
4646
# monitoring hooked up to it to make sure that these errors don't go

edx_django_utils/user/management/commands/manage_user.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _handle_remove(self, username, email):
8888
user.delete()
8989

9090
@transaction.atomic
91-
def handle( # pylint: disable=arguments-differ
91+
def handle( # pylint: disable=too-many-positional-arguments, arguments-differ
9292
self, username, email, is_remove, is_staff, is_superuser, groups,
9393
unusable_password, initial_password_hash, *args, **options
9494
):

requirements/base.txt

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
55
# make upgrade
66
#
77
asgiref==3.8.1
88
# via django
9-
backports-zoneinfo==0.2.1 ; python_version < "3.9"
10-
# via
11-
# -c requirements/constraints.txt
12-
# django
13-
cffi==1.16.0
9+
cffi==1.17.1
1410
# via pynacl
1511
click==8.1.7
1612
# via -r requirements/base.in
17-
django==4.2.11
13+
django==4.2.16
1814
# via
1915
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
2016
# -r requirements/base.in
@@ -24,19 +20,17 @@ django-crum==0.7.9
2420
# via -r requirements/base.in
2521
django-waffle==4.1.0
2622
# via -r requirements/base.in
27-
newrelic==9.8.0
23+
newrelic==10.0.0
2824
# via -r requirements/base.in
29-
pbr==6.0.0
25+
pbr==6.1.0
3026
# via stevedore
31-
psutil==5.9.8
27+
psutil==6.0.0
3228
# via -r requirements/base.in
33-
pycparser==2.21
29+
pycparser==2.22
3430
# via cffi
3531
pynacl==1.5.0
3632
# via -r requirements/base.in
37-
sqlparse==0.4.4
33+
sqlparse==0.5.1
3834
# via django
39-
stevedore==5.2.0
35+
stevedore==5.3.0
4036
# via -r requirements/base.in
41-
typing-extensions==4.10.0
42-
# via asgiref

requirements/ci.txt

+9-13
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.8
2+
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
55
# make upgrade
66
#
7-
cachetools==5.3.3
7+
cachetools==5.5.0
88
# via tox
99
chardet==5.2.0
1010
# via tox
1111
colorama==0.4.6
1212
# via tox
1313
distlib==0.3.8
1414
# via virtualenv
15-
filelock==3.13.3
15+
filelock==3.16.1
1616
# via
1717
# tox
1818
# virtualenv
19-
packaging==24.0
19+
packaging==24.1
2020
# via
2121
# pyproject-api
2222
# tox
23-
platformdirs==4.2.0
23+
platformdirs==4.3.6
2424
# via
2525
# tox
2626
# virtualenv
27-
pluggy==1.4.0
27+
pluggy==1.5.0
2828
# via tox
29-
pyproject-api==1.6.1
29+
pyproject-api==1.8.0
3030
# via tox
31-
tomli==2.0.1
32-
# via
33-
# pyproject-api
34-
# tox
35-
tox==4.14.2
31+
tox==4.21.1
3632
# via -r requirements/ci.in
37-
virtualenv==20.25.1
33+
virtualenv==20.26.6
3834
# via tox

requirements/constraints.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010

1111
# Common constraints for edx repos
1212
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
13-
13+
1414
# diff-cover latest requires (pluggy>=0.13.1,<0.14.0)
1515
# which conflicts with pytest(pluggy>=0.12,<2.0.0) and tox(pluggy>0.12) both of these fetch pluggy==1.0.0
1616
diff-cover<6.2.2
1717

1818

19-
# greater version failing docs build
20-
sphinx==4.2.0
21-
2219
# version 1.0.0 requires docutils >0.19 but sphinx@4.2.0 needs docutils<0.18
2320
doc8<1.0.0
2421

0 commit comments

Comments
 (0)