feat(integrations): Support Django 5.1
- test Django test suite against
5.1b1 - fix any issues that come up, like this one:
AttributeError: <module 'django.urls.resolvers' from '/home/runner/work/sentry-python/sentry-python/.tox/py3.10-django-v5.1/lib/python3.10/site-packages/django/urls/resolvers.py'> does not have the attribute 'get_converter'
Closes https://github.com/getsentry/sentry-python/issues/3208
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 79.46%. Comparing base (
c76168c) to head (d6b567f).
Additional details and impacted files
@@ Coverage Diff @@
## master #3207 +/- ##
=======================================
Coverage 79.46% 79.46%
=======================================
Files 133 133
Lines 14290 14290
Branches 3004 3004
=======================================
Hits 11355 11355
Misses 2089 2089
Partials 846 846
https://github.com/getsentry/sentry-python/blob/407f651f66fa811a20241579aa7881de624b3e20/tests/integrations/django/test_transactions.py#L98
Something like:
@pytest.mark.skipif(
django.VERSION >= (5, 1)
reason="django.urls.converters.get_converter() function was removed in Django v5.1",
)
https://docs.djangoproject.com/en/dev/releases/5.1/#miscellaneous
The undocumented
django.urls.converters.get_converter()function is removed.
Thanks @cclauss, I'm now skipping the old test for 5.1 and I've added another for 5.1+ that uses get_converters instead. If anyone's interested, here is the Django change that prompted this.
So the test suite is passing now, I'll do some manual testing as well and then we should be good to go.