Skip to content

Commit

Permalink
Update tox.ini to test more versions of django / `djangorestframe…
Browse files Browse the repository at this point in the history
…work` (#1)

* Adds more combinations to `tox.ini`
* Updates `README.rst`
* Fixes minor linting issues that cause CI failure
  • Loading branch information
SupImDos authored Mar 27, 2024
1 parent 78031f0 commit 904403d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Generate **real** Swagger/OpenAPI 2.0 specifications from a Django Rest Framewor

Compatible with

- **Django Rest Framework**: 3.10, 3.11, 3.12, 3.13, 3.14
- **Django**: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1
- **Django Rest Framework**: 3.10, 3.11, 3.12, 3.13, 3.14, 3.15
- **Django**: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0
- **Python**: 3.6, 3.7, 3.8, 3.9, 3.10, 3.11

Only the latest patch version of each ``major.minor`` series of Python, Django and Django REST Framework is supported.
Expand Down
2 changes: 1 addition & 1 deletion src/drf_yasg/inspectors/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_queryset_from_view(view, serializer=None):

if queryset is not None and serializer is not None:
# make sure the view is actually using *this* serializer
assert type(serializer) == call_view_method(view, 'get_serializer_class', 'serializer_class')
assert type(serializer) is call_view_method(view, 'get_serializer_class', 'serializer_class')

return queryset
except Exception: # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions src/drf_yasg/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SwaggerDict(OrderedDict):
def __init__(self, **attrs):
super(SwaggerDict, self).__init__()
self._extras__ = attrs
if type(self) == SwaggerDict:
if type(self) is SwaggerDict:
self._insert_extras__()

def __setattr__(self, key, value):
Expand Down Expand Up @@ -516,7 +516,7 @@ def __init__(self, resolver, name, scope, expected_type, ignore_unresolved=False
:param bool ignore_unresolved: do not throw if the referenced object does not exist
"""
super(_Ref, self).__init__()
assert not type(self) == _Ref, "do not instantiate _Ref directly"
assert type(self) is not _Ref, "do not instantiate _Ref directly"
ref_name = "#/{scope}/{name}".format(scope=scope, name=name)
if not ignore_unresolved:
obj = resolver.get(name, scope)
Expand Down
2 changes: 1 addition & 1 deletion src/drf_yasg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def force_real_str(s, encoding='utf-8', strings_only=False, errors='strict'):
"""
if s is not None:
s = force_str(s, encoding, strings_only, errors)
if type(s) != str:
if type(s) is not str: # noqa: E721
s = '' + s

# Remove common indentation to get the correct Markdown rendering
Expand Down
17 changes: 10 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ isolated_build_env = .package

# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
envlist =
py{37,38,39}-django{22,30}-drf{310,311,312},
py{37,38,39}-django{31,32}-drf{311,312},
py{39,310}-django{40,41}-drf{313,314}
py311-django{40,41,42}-drf314
py38-{lint, docs},
py310-djmaster
py{37,38,39}-django{22,30}-drf{310,311,312}
py{37,38,39}-django{31,32}-drf{311,312}
py{38,39,310}-django{40,41}-drf{313,314,315}
py{38,39,310,311}-django42-drf{314,315}
py{310,311}-django50-drf{314,315}
py38-{lint,docs}
py311-djmaster

skip_missing_interpreters = true

Expand All @@ -29,13 +30,15 @@ deps =
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<5
django42: Django>=4.2,<5.0
django50: Django>=5.0,<5.1

drf310: djangorestframework>=3.10,<3.11
drf311: djangorestframework>=3.11,<3.12
drf312: djangorestframework>=3.12,<3.13
drf313: djangorestframework>=3.13,<3.14
drf314: djangorestframework>=3.14,<3.15
drf315: djangorestframework>=3.15,<3.16

typing: typing>=3.6.6

Expand Down

0 comments on commit 904403d

Please sign in to comment.