django-rest-framework/rest_framework/schemas
Bruno Alla b25028ac8f
Add support for Python 3.13 (#9527)
* Add support for Python 3.13

* Fix extracting tox env with -dev Python versions

* Fix view description inspection in Python 3.13

Python 3.13 introduced docstrings for None: https://github.com/python/cpython/pull/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.
2024-09-11 15:39:52 +06:00
..
__init__.py Update linter requirements (#7010) 2019-10-22 11:18:51 -07:00
coreapi.py Added Deprecation Warnings for CoreAPI (#7519) 2023-06-13 12:55:22 +06:00
generators.py Fix typo (#9231) 2024-01-24 23:17:01 +01:00
inspectors.py Add support for Python 3.13 (#9527) 2024-09-11 15:39:52 +06:00
openapi.py Update deprecation hints 2024-04-30 18:28:23 +02:00
utils.py Fix Django 3.0 deprecations (#7074) 2019-12-04 14:14:43 -08:00
views.py Added OpenAPI Schema Generation. (#6532) 2019-05-13 16:07:03 +02:00