-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Add support for Python 3.13 #9527
Conversation
Python 3.13 introduced docstrings for None: python/cpython#117813 In Python 3.12, this is an empty string: ``` ➜ python3.12 Python 3.12.6 (main, Sep 10 2024, 19:06:17) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> d = None >>> d.__doc__ >>> ``` In Python 3.13, it's no longer empty: ``` ➜ python3.13 Python 3.13.0rc2+ (heads/3.13:660baa1, Sep 10 2024, 18:57:50) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> d = None >>> d.__doc__ 'The type of the None singleton.' >>> ``` Adding a check in the inspector that get the view description out the view function docstring to catch this edge case.
@@ -4,6 +4,7 @@ envlist = | |||
{py310}-{django42,django50,django51,djangomain} | |||
{py311}-{django42,django50,django51,djangomain} | |||
{py312}-{django42,django50,django51,djangomain} | |||
{py313}-{django51,djangomain} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.13 will be supported only by Django 5.1 and above: https://forum.djangoproject.com/t/backport-python-3-13-support-in-django-5-0/34671/2
The home page at https://www.django-rest-framework.org/ doesn't include Python 3.13 in the "Requirements". Is this intended or needs to be updated ? |
It's intended: this page lists the versions supported by the latest release of DRF, and while this pull request is merged, the change is still unreleased. If you look at the release process here, you'll see that there is a step to deploy the documentation. |
Description
Issues found
1. Fix view description inspection
Python 3.13 introduced docstrings for the
None
singletong: python/cpython#117813In Python 3.12, this is an empty string:
In Python 3.13, it's no longer empty:
The fix: added a check in the inspector that get the view description out the view function docstring to catch this edge case.