Skip to content

Commit 73f3e0a

Browse files
committed
Bumped removal to DRF315
1 parent 560e581 commit 73f3e0a

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

rest_framework/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ class RemovedInDRF313Warning(DeprecationWarning):
3535

3636
class RemovedInDRF314Warning(PendingDeprecationWarning):
3737
pass
38+
39+
40+
class RemovedInDRF315Warning(PendingDeprecationWarning):
41+
pass

rest_framework/filters.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from django.utils.encoding import force_str
1414
from django.utils.translation import gettext_lazy as _
1515

16-
from rest_framework import RemovedInDRF314Warning
16+
from rest_framework import RemovedInDRF315Warning
1717
from rest_framework.compat import coreapi, coreschema, distinct
1818
from rest_framework.settings import api_settings
1919

@@ -32,7 +32,7 @@ def filter_queryset(self, request, queryset, view):
3232
def get_schema_fields(self, view):
3333
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
3434
if coreapi is not None:
35-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
35+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
3636
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
3737
return []
3838

@@ -151,7 +151,7 @@ def to_html(self, request, queryset, view):
151151
def get_schema_fields(self, view):
152152
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
153153
if coreapi is not None:
154-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
154+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
155155
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
156156
return [
157157
coreapi.Field(
@@ -303,7 +303,7 @@ def to_html(self, request, queryset, view):
303303
def get_schema_fields(self, view):
304304
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
305305
if coreapi is not None:
306-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
306+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
307307
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
308308
return [
309309
coreapi.Field(

rest_framework/pagination.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from django.utils.encoding import force_str
1414
from django.utils.translation import gettext_lazy as _
1515

16-
from rest_framework import RemovedInDRF314Warning
16+
from rest_framework import RemovedInDRF315Warning
1717
from rest_framework.compat import coreapi, coreschema
1818
from rest_framework.exceptions import NotFound
1919
from rest_framework.response import Response
@@ -152,7 +152,7 @@ def get_results(self, data):
152152
def get_schema_fields(self, view):
153153
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
154154
if coreapi is not None:
155-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
155+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
156156
return []
157157

158158
def get_schema_operation_parameters(self, view):
@@ -312,7 +312,7 @@ def to_html(self):
312312
def get_schema_fields(self, view):
313313
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
314314
if coreapi is not None:
315-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
315+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
316316
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
317317
fields = [
318318
coreapi.Field(
@@ -532,7 +532,7 @@ def get_count(self, queryset):
532532
def get_schema_fields(self, view):
533533
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
534534
if coreapi is not None:
535-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
535+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
536536
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
537537
return [
538538
coreapi.Field(
@@ -933,7 +933,7 @@ def to_html(self):
933933
def get_schema_fields(self, view):
934934
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
935935
if coreapi is not None:
936-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
936+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
937937
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
938938
fields = [
939939
coreapi.Field(

rest_framework/schemas/coreapi.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.db import models
66
from django.utils.encoding import force_str
77

8-
from rest_framework import RemovedInDRF314Warning, exceptions, serializers
8+
from rest_framework import RemovedInDRF315Warning, exceptions, serializers
99
from rest_framework.compat import coreapi, coreschema, uritemplate
1010
from rest_framework.settings import api_settings
1111

@@ -119,7 +119,7 @@ class SchemaGenerator(BaseSchemaGenerator):
119119
def __init__(self, title=None, url=None, description=None, patterns=None, urlconf=None, version=None):
120120
assert coreapi, '`coreapi` must be installed for schema support.'
121121
if coreapi is not None:
122-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
122+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
123123
assert coreschema, '`coreschema` must be installed for schema support.'
124124

125125
super(SchemaGenerator, self).__init__(title, url, description, patterns, urlconf)
@@ -350,7 +350,7 @@ def __init__(self, manual_fields=None):
350350
"""
351351
super(AutoSchema, self).__init__()
352352
if coreapi is not None:
353-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
353+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
354354
if manual_fields is None:
355355
manual_fields = []
356356
self._manual_fields = manual_fields
@@ -593,7 +593,7 @@ def __init__(self, fields, description='', encoding=None):
593593
"""
594594
super(ManualSchema, self).__init__()
595595
if coreapi is not None:
596-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
596+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
597597
assert all(isinstance(f, coreapi.Field) for f in fields), "`fields` must be a list of coreapi.Field instances"
598598
self._fields = fields
599599
self._description = description
@@ -616,5 +616,5 @@ def get_link(self, path, method, base_url):
616616
def is_enabled():
617617
"""Is CoreAPI Mode enabled?"""
618618
if coreapi is not None:
619-
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.14', RemovedInDRF314Warning)
619+
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.15', RemovedInDRF315Warning)
620620
return issubclass(api_settings.DEFAULT_SCHEMA_CLASS, AutoSchema)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ license_file = LICENSE.md
44
[tool:pytest]
55
addopts=--tb=short --strict -ra
66
testspath = tests
7-
filterwarnings = ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF314Warning
7+
filterwarnings = ignore:CoreAPI compatibility is deprecated*:rest_framework.RemovedInDRF315Warning
88

99
[flake8]
1010
ignore = E501,W504

tests/schemas/test_coreapi.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from django.urls import include, path
88

99
from rest_framework import (
10-
RemovedInDRF314Warning, filters, generics, pagination, permissions,
10+
RemovedInDRF315Warning, filters, generics, pagination, permissions,
1111
serializers
1212
)
1313
from rest_framework.compat import coreapi, coreschema
@@ -1384,42 +1384,42 @@ def test_schema_handles_exception():
13841384

13851385
@pytest.mark.skipif(not coreapi, reason='coreapi is not installed')
13861386
def test_coreapi_deprecation():
1387-
with pytest.warns(RemovedInDRF314Warning):
1387+
with pytest.warns(RemovedInDRF315Warning):
13881388
SchemaGenerator()
13891389

1390-
with pytest.warns(RemovedInDRF314Warning):
1390+
with pytest.warns(RemovedInDRF315Warning):
13911391
AutoSchema()
13921392

1393-
with pytest.warns(RemovedInDRF314Warning):
1393+
with pytest.warns(RemovedInDRF315Warning):
13941394
ManualSchema({})
13951395

1396-
with pytest.warns(RemovedInDRF314Warning):
1396+
with pytest.warns(RemovedInDRF315Warning):
13971397
deprecated_filter = OrderingFilter()
13981398
deprecated_filter.get_schema_fields({})
13991399

1400-
with pytest.warns(RemovedInDRF314Warning):
1400+
with pytest.warns(RemovedInDRF315Warning):
14011401
deprecated_filter = BaseFilterBackend()
14021402
deprecated_filter.get_schema_fields({})
14031403

1404-
with pytest.warns(RemovedInDRF314Warning):
1404+
with pytest.warns(RemovedInDRF315Warning):
14051405
deprecated_filter = SearchFilter()
14061406
deprecated_filter.get_schema_fields({})
14071407

1408-
with pytest.warns(RemovedInDRF314Warning):
1408+
with pytest.warns(RemovedInDRF315Warning):
14091409
paginator = BasePagination()
14101410
paginator.get_schema_fields({})
14111411

1412-
with pytest.warns(RemovedInDRF314Warning):
1412+
with pytest.warns(RemovedInDRF315Warning):
14131413
paginator = PageNumberPagination()
14141414
paginator.get_schema_fields({})
14151415

1416-
with pytest.warns(RemovedInDRF314Warning):
1416+
with pytest.warns(RemovedInDRF315Warning):
14171417
paginator = LimitOffsetPagination()
14181418
paginator.get_schema_fields({})
14191419

1420-
with pytest.warns(RemovedInDRF314Warning):
1420+
with pytest.warns(RemovedInDRF315Warning):
14211421
paginator = CursorPagination()
14221422
paginator.get_schema_fields({})
14231423

1424-
with pytest.warns(RemovedInDRF314Warning):
1424+
with pytest.warns(RemovedInDRF315Warning):
14251425
is_enabled()

0 commit comments

Comments
 (0)