remove support for python 3.7

This commit is contained in:
Mathieu Dupuy 2024-01-20 12:09:03 +01:00
parent ded21590b8
commit 8e2f401acd
No known key found for this signature in database
GPG Key ID: 08C1D4F32506B23A
12 changed files with 7 additions and 54 deletions

View File

@ -14,7 +14,6 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: python-version:
- '3.7'
- '3.8' - '3.8'
- '3.9' - '3.9'
- '3.10' - '3.10'

View File

@ -54,7 +54,7 @@ There is a live example API for testing purposes, [available here][sandbox].
# Requirements # Requirements
* Python 3.7+ * Python 3.8+
* Django 4.2, 4.1, 4.0, 3.2, 3.1, 3.0 * Django 4.2, 4.1, 4.0, 3.2, 3.1, 3.0
We **highly recommend** and only officially support the latest patch release of We **highly recommend** and only officially support the latest patch release of

View File

@ -85,7 +85,7 @@ continued development by **[signing up for a paid plan][funding]**.
REST framework requires the following: REST framework requires the following:
* Python (3.7, 3.8, 3.9, 3.10, 3.11) * Python (3.8, 3.9, 3.10, 3.11)
* Django (3.0, 3.1, 3.2, 4.0, 4.1, 4.2) * Django (3.0, 3.1, 3.2, 4.0, 4.1, 4.2)
We **highly recommend** and only officially support the latest patch release of We **highly recommend** and only officially support the latest patch release of

View File

@ -8,7 +8,7 @@ from io import open
from setuptools import find_packages, setup from setuptools import find_packages, setup
CURRENT_PYTHON = sys.version_info[:2] CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 7) REQUIRED_PYTHON = (3, 8)
# This check and everything above must remain compatible with Python 2.7. # This check and everything above must remain compatible with Python 2.7.
if CURRENT_PYTHON < REQUIRED_PYTHON: if CURRENT_PYTHON < REQUIRED_PYTHON:
@ -84,7 +84,7 @@ setup(
packages=find_packages(exclude=['tests*']), packages=find_packages(exclude=['tests*']),
include_package_data=True, include_package_data=True,
install_requires=["django>=3.0", 'backports.zoneinfo;python_version<"3.9"'], install_requires=["django>=3.0", 'backports.zoneinfo;python_version<"3.9"'],
python_requires=">=3.7", python_requires=">=3.8",
zip_safe=False, zip_safe=False,
classifiers=[ classifiers=[
'Development Status :: 5 - Production/Stable', 'Development Status :: 5 - Production/Stable',
@ -101,7 +101,6 @@ setup(
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',

View File

@ -640,10 +640,6 @@ class Test5087Regression:
class TestTyping(TestCase): class TestTyping(TestCase):
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_field_is_subscriptable(self): def test_field_is_subscriptable(self):
assert serializers.Field is serializers.Field["foo"] assert serializers.Field is serializers.Field["foo"]

View File

@ -1,5 +1,3 @@
import sys
import pytest import pytest
from django.db import models from django.db import models
from django.http import Http404 from django.http import Http404
@ -703,23 +701,11 @@ class TestSerializer(TestCase):
class TestTyping(TestCase): class TestTyping(TestCase):
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_genericview_is_subscriptable(self): def test_genericview_is_subscriptable(self):
assert generics.GenericAPIView is generics.GenericAPIView["foo"] assert generics.GenericAPIView is generics.GenericAPIView["foo"]
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_listview_is_subscriptable(self): def test_listview_is_subscriptable(self):
assert generics.ListAPIView is generics.ListAPIView["foo"] assert generics.ListAPIView is generics.ListAPIView["foo"]
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_instanceview_is_subscriptable(self): def test_instanceview_is_subscriptable(self):
assert generics.RetrieveAPIView is generics.RetrieveAPIView["foo"] assert generics.RetrieveAPIView is generics.RetrieveAPIView["foo"]

View File

@ -8,7 +8,6 @@ an appropriate set of serializer fields for each case.
import datetime import datetime
import decimal import decimal
import json # noqa import json # noqa
import sys
import tempfile import tempfile
import django import django
@ -398,10 +397,6 @@ class TestDurationFieldMapping(TestCase):
fields = '__all__' fields = '__all__'
expected = dedent(""" expected = dedent("""
TestSerializer():
id = IntegerField(label='ID', read_only=True)
duration_field = DurationField(max_value=datetime.timedelta(3), min_value=datetime.timedelta(1))
""") if sys.version_info < (3, 7) else dedent("""
TestSerializer(): TestSerializer():
id = IntegerField(label='ID', read_only=True) id = IntegerField(label='ID', read_only=True)
duration_field = DurationField(max_value=datetime.timedelta(days=3), min_value=datetime.timedelta(days=1)) duration_field = DurationField(max_value=datetime.timedelta(days=3), min_value=datetime.timedelta(days=1))

View File

@ -3,7 +3,6 @@ Tests for content parsing, and form-overloaded content parsing.
""" """
import copy import copy
import os.path import os.path
import sys
import tempfile import tempfile
import pytest import pytest
@ -356,9 +355,5 @@ class TestDeepcopy(TestCase):
class TestTyping(TestCase): class TestTyping(TestCase):
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_request_is_subscriptable(self): def test_request_is_subscriptable(self):
assert Request is Request["foo"] assert Request is Request["foo"]

View File

@ -1,6 +1,3 @@
import sys
import pytest
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
from django.urls import include, path, re_path from django.urls import include, path, re_path
@ -289,9 +286,5 @@ class Issue807Tests(TestCase):
class TestTyping(TestCase): class TestTyping(TestCase):
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_response_is_subscriptable(self): def test_response_is_subscriptable(self):
assert Response is Response["foo"] assert Response is Response["foo"]

View File

@ -206,10 +206,6 @@ class TestSerializer:
exceptions.ErrorDetail(string='Raised error', code='invalid') exceptions.ErrorDetail(string='Raised error', code='invalid')
]} ]}
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_serializer_is_subscriptable(self): def test_serializer_is_subscriptable(self):
assert serializers.Serializer is serializers.Serializer["foo"] assert serializers.Serializer is serializers.Serializer["foo"]

View File

@ -1,5 +1,3 @@
import sys
import pytest import pytest
from django.http import QueryDict from django.http import QueryDict
from django.utils.datastructures import MultiValueDict from django.utils.datastructures import MultiValueDict
@ -60,10 +58,6 @@ class TestListSerializer:
assert serializer.is_valid() assert serializer.is_valid()
assert serializer.validated_data == expected_output assert serializer.validated_data == expected_output
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="subscriptable classes requires Python 3.7 or higher",
)
def test_list_serializer_is_subscriptable(self): def test_list_serializer_is_subscriptable(self):
assert serializers.ListSerializer is serializers.ListSerializer["foo"] assert serializers.ListSerializer is serializers.ListSerializer["foo"]

View File

@ -1,8 +1,8 @@
[tox] [tox]
envlist = envlist =
{py36,py37,py38,py39}-django30 {py38,py39}-django30
{py36,py37,py38,py39}-django31 {py38,py39}-django31
{py36,py37,py38,py39,py310}-django32 {py38,py39,py310}-django32
{py38,py39,py310}-{django40,django41,django42,djangomain} {py38,py39,py310}-{django40,django41,django42,djangomain}
{py311}-{django41,django42,djangomain} {py311}-{django41,django42,djangomain}
base base