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

Python 3.12 #4644

Closed
foarsitter opened this issue Oct 25, 2023 · 12 comments · Fixed by #4930
Closed

Python 3.12 #4644

foarsitter opened this issue Oct 25, 2023 · 12 comments · Fixed by #4930

Comments

@foarsitter
Copy link
Collaborator

foarsitter commented Oct 25, 2023

Abused the create_django_issue.py script to create a table for Python 3.12.

There is a lot of work to do:

base.txt

Name Version in Master 3.12 Compatible Version OK Issue / PR
python-slugify 8.0.1 un33k/python-slugify#138
Pillow 10.1.0 10.1.0
rcssmin 1.1.1 1.1.2 #4614
argon2-cffi 23.1.0 23.1.0
whitenoise 6.6.0 6.6.0
redis 5.0.3 redis/redis-py#2979
hiredis 2.3.2 2.3.1 redis/hiredis-py#172
celery 5.3.5 celery/celery#8549
django-celery-beat 2.6.0 celery/django-celery-beat#691
flower 2.0.1 mher/flower#1334
uvicorn 0.24.0.post1 0.24.0 encode/uvicorn#2145
django 4.2.8 4.2.8 django/django#17331
django-environ 0.11.2 >0.11.2 joke2k/django-environ#508
django-model-utils 4.4.0 > 4.3.1 / 3.12-dev jazzband/django-model-utils#545
django-allauth 0.57.0 0.57.0 pennersr/django-allauth#3463
django-crispy-forms 2.1 2.1
crispy-bootstrap5 2023.10 2023.10 django-crispy-forms/crispy-bootstrap5#155
django-compressor 4.4 django-compressor/django-compressor#1214
django-redis 5.4.0 jazzband/django-redis#689
djangorestframework 3.15.0
django-cors-headers 4.3.0 4.3.0
drf-spectacular 0.27.0 0.27.0 tfranzel/drf-spectacular#1096
django-webpack-loader 2.0.1 2.0.1 django-webpack/django-webpack-loader#357

local.txt

Name Version in Master 3.12 Compatible Version OK Issue / PR
Werkzeug 3.0.0 n/a
ipdb 0.13.13
psycopg 3.1.12 3.1.12
watchfiles 0.21.0 0.21.0
mypy 1.6.1
django-stubs 4.2.7 4.2.6
pytest 7.4.2 7.4.3
pytest-sugar 1.0.0
djangorestframework-stubs 3.14.4 3.14.4
sphinx 7.2.6 7.2.6
sphinx-autobuild 2021.3.14 2021.3.14 sphinx-doc/sphinx-autobuild#139
flake8 6.1.0 n/a
flake8-isort 6.1.0 6.1.0 3.12.0-beta.2
coverage 7.3.2 7.3.2
black 23.10.1 23.10.1
djlint 1.34.1 djlint/djLint#781
pylint-django 2.5.5 pylint-dev/pylint-django#415
pylint-celery 0.3 n/a
pre-commit 3.5.0 n/a
factory-boy 3.3.0 3.3.0 CI
django-debug-toolbar 4.2.0 4.2.0 CI
django-extensions 3.2.3 django-extensions/django-extensions#1849
django-coverage-plugin 3.1.0 3.1.0
pytest-django 4.7.0 4.7.0 pytest-dev/pytest-django#1086

production.txt

Name Version in Master 3.12 Compatible Version OK Issue / PR
gunicorn 21.2.0 21.2.0
psycopg 3.1.12 3.1.12
Collectfast 2.2.0 Unmaintained ✴️
sentry-sdk 1.33.0 >1.32.0 getsentry/sentry-python#2299
hiredis 2.3.2 redis/hiredis-py#174
django-storages 1.14.2 jschneier/django-storages#1331
django-anymail 10.2 10.2
@browniebroke
Copy link
Member

As of today, we'd also need to update to Django 5.0 first:

What Python version can I use with Django

Django version Python versions
3.2 3.6, 3.7, 3.8, 3.9, 3.10 (added in 3.2.9)
4.0 3.8, 3.9, 3.10
4.1 3.8, 3.9, 3.10, 3.11 (added in 4.1.3)
4.2 3.8, 3.9, 3.10, 3.11
5.0 3.10, 3.11, 3.12
5.1 3.10, 3.11, 3.12

https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django

@foarsitter
Copy link
Collaborator Author

Since november django is being tested with 3.12: django/django#16274

@foarsitter
Copy link
Collaborator Author

Its seems that 4.2.7 will officially support 3.12: https://forum.djangoproject.com/t/django-4-2-lts-compatibility-with-python-3-12/24508/3

@browniebroke
Copy link
Member

As per #4903, it looks like we were generating projects running Python 3.12 for about a month, and nobody really noticed, so we're probably good to move this forward. The projects which are still red in the table above are probably just signalling compatibilty in their trove classifiers.

I've upgraded one of a project and the main blocker I hit was this one, with Django debug toolbar, when making concurrent requests locally.

@foarsitter
Copy link
Collaborator Author

          @WisdomPill We have an issue with async SSL in 3.12. But this should release in the 5.x final.

Originally posted by @chayim in jazzband/django-redis#689 (comment)

The redis package is my only concern but we aren't using async + SSL so we can go ahead I think.

@akashvibhute
Copy link

@foarsitter the issue django-commons/django-debug-toolbar#1875 still occurs quite frequently with 3.12 and this django release. Its borderline unusable with docker/async config for development without disabling debug toolbar entirely.

@foarsitter
Copy link
Collaborator Author

@akashvibhute What do you want me to do?

By yourself you have two options: 1) fix the issue in the toolbar 2) revert to python 3.11

@browniebroke
Copy link
Member

You can also untick the profiling panel in the debug toolbar, if you don't need it, and you can benefit from the other panels (SQL etc...)

@akashvibhute
Copy link

@foarsitter nothing, I was just informing.

@browniebroke
Yes, of course. But it is irritating to have to do that every time, especially if I have multiple tabs open (for a multi tenant app).
For now, I remove the debug toolbar urls/middleware and only use them when doing performance analysis.

@akashvibhute
Copy link

akashvibhute commented Apr 17, 2024

I just realized that I can also completely disable profile panel from adding it to DISABLE_PANELS under DEBUG_TOOLBAR_CONFIG in local settings file.

@browniebroke maybe that should be the default in the project till the issue is closed.

@browniebroke
Copy link
Member

browniebroke commented Apr 17, 2024

maybe that should be the default in the project till the issue is closed.

Feel free to send us a PR with some comments explaining why it's disabled and linking to the DDT issue 👍🏻

@agusmakmun
Copy link

agusmakmun commented Apr 29, 2024

I just realized that I can also completely disable profile panel from adding it to DISABLE_PANELS under DEBUG_TOOLBAR_CONFIG in local settings file.

Yup, me too by adding this:

DEBUG_TOOLBAR_CONFIG = {
    "DISABLE_PANELS": [
        "debug_toolbar.panels.profiling.ProfilingPanel",  # additional one
        "debug_toolbar.panels.redirects.RedirectsPanel",
    ],
    "SHOW_TEMPLATE_CONTEXT": True,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants