Add Django 3.0, DRF 3.11, drop Python 3.5, Django 2.1
parent
6a1166deb5
commit
a872eb66d6
|
|
@ -1,7 +1,6 @@
|
|||
language: python
|
||||
python:
|
||||
- '2.7'
|
||||
- '3.5'
|
||||
- '3.6'
|
||||
- '3.7'
|
||||
- '3.8'
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
|||
|
||||
.. code:: console
|
||||
|
||||
(venv) $ python testproj/manage.py generate_swagger ../tests/reference.yaml --overwrite --user admin --url http://test.local:8002/
|
||||
(venv) $ python testproj/manage.py generate_swagger tests/reference.yaml --overwrite --user admin --url http://test.local:8002/
|
||||
|
||||
After checking the git diff to verify that no unexpected changes appeared, you should commit the new
|
||||
``reference.yaml`` together with your changes.
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ Generate **real** Swagger/OpenAPI 2.0 specifications from a Django Rest Framewor
|
|||
|
||||
Compatible with
|
||||
|
||||
- **Django Rest Framework**: 3.8, 3.9, 3.10
|
||||
- **Django**: 1.11, 2.1, 2.2
|
||||
- **Python**: 2.7, 3.5, 3.6, 3.7, 3.8
|
||||
- **Django Rest Framework**: 3.8, 3.9, 3.10, 3.11
|
||||
- **Django**: 1.11, 2.2, 3.0
|
||||
- **Python**: 2.7, 3.6, 3.7, 3.8
|
||||
|
||||
Only the latest patch version of each ``major.minor`` series of Python, Django and Django REST Framework is supported.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,3 +4,4 @@
|
|||
-r lint.txt
|
||||
|
||||
tox-battery>=0.5
|
||||
django-oauth-toolkit
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
Pillow>=4.3.0
|
||||
django-filter>=1.1.0,<2.0; python_version == "2.7"
|
||||
django-filter>=1.1.0; python_version >= "3.5"
|
||||
#djangorestframework-camel-case>=0.2.0
|
||||
# tempory replacement of broken lib
|
||||
-e git+https://github.com/tfranzel/djangorestframework-camel-case.git@bd556d38fa7382acadfe91d93d92d99c663248a9#egg=djangorestframework_camel_case
|
||||
djangorestframework-camel-case>=1.1.2
|
||||
djangorestframework-recursive>=0.1.2
|
||||
dj-database-url>=0.4.2
|
||||
user_agents>=1.1.0
|
||||
django-cors-headers
|
||||
|
|
|
|||
|
|
@ -481,7 +481,10 @@ def get_field_default(field):
|
|||
try:
|
||||
if hasattr(default, 'set_context'):
|
||||
default.set_context(field)
|
||||
default = default()
|
||||
if getattr(default, 'requires_context', False):
|
||||
default = default(field)
|
||||
else:
|
||||
default = default()
|
||||
except Exception: # pragma: no cover
|
||||
logger.warning("default for %s is callable but it raised an exception when "
|
||||
"called; 'default' will not be set on schema", field, exc_info=True)
|
||||
|
|
|
|||
|
|
@ -193,16 +193,6 @@ LOGGING = {
|
|||
'propagate': False,
|
||||
},
|
||||
'django': {
|
||||
'handlers': ['console_log'],
|
||||
'level': 'DEBUG',
|
||||
'propagate': False,
|
||||
},
|
||||
'django.db.backends': {
|
||||
'handlers': ['console_log'],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
},
|
||||
'django.template': {
|
||||
'handlers': ['console_log'],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import sys
|
|||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.hashers import make_password
|
||||
from django.db import migrations, IntegrityError
|
||||
from django.db import migrations, IntegrityError, transaction
|
||||
|
||||
|
||||
def add_default_user(apps, schema_editor):
|
||||
|
|
@ -13,14 +13,15 @@ def add_default_user(apps, schema_editor):
|
|||
User = apps.get_model(settings.AUTH_USER_MODEL)
|
||||
|
||||
try:
|
||||
admin = User(
|
||||
username=username,
|
||||
email=email,
|
||||
password=make_password(password),
|
||||
is_superuser=True,
|
||||
is_staff=True
|
||||
)
|
||||
admin.save()
|
||||
with transaction.atomic():
|
||||
admin = User(
|
||||
username=username,
|
||||
email=email,
|
||||
password=make_password(password),
|
||||
is_superuser=True,
|
||||
is_staff=True
|
||||
)
|
||||
admin.save()
|
||||
except IntegrityError:
|
||||
sys.stdout.write(" User '%s <%s>' already exists..." % (username, email))
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
swagger: '2.0'
|
||||
info:
|
||||
title: Snippets API
|
||||
description: "This is a demo project for the [drf-yasg](https://github.com/axnsan12/drf-yasg)\
|
||||
\ Django Rest Framework library.\n\nThe `swagger-ui` view can be found [here](/cached/swagger).\
|
||||
\nThe `ReDoc` view can be found [here](/cached/redoc).\nThe swagger YAML\
|
||||
\ document can be found [here](/cached/swagger.yaml).\n\nYou can log in using\
|
||||
\ the pre-existing `admin` user with password `passwordadmin`."
|
||||
description: |-
|
||||
This is a demo project for the [drf-yasg](https://github.com/axnsan12/drf-yasg) Django Rest Framework library.
|
||||
|
||||
The `swagger-ui` view can be found [here](/cached/swagger).
|
||||
The `ReDoc` view can be found [here](/cached/redoc).
|
||||
The swagger YAML document can be found [here](/cached/swagger.yaml).
|
||||
|
||||
You can log in using the pre-existing `admin` user with password `passwordadmin`.
|
||||
termsOfService: https://www.google.com/policies/terms/
|
||||
contact:
|
||||
email: contact@snippets.local
|
||||
|
|
@ -1502,7 +1505,9 @@ definitions:
|
|||
readOnly: true
|
||||
help_text_example_3:
|
||||
title: Help text example 3
|
||||
description: "\n docstring is set so should appear in swagger as fallback\n\
|
||||
\ :return:\n "
|
||||
description: |2
|
||||
|
||||
docstring is set so should appear in swagger as fallback
|
||||
:return:
|
||||
type: integer
|
||||
readOnly: true
|
||||
|
|
|
|||
16
tox.ini
16
tox.ini
|
|
@ -7,9 +7,9 @@ isolated_build_env = .package
|
|||
envlist =
|
||||
py27-django111-drf39-typing,
|
||||
py27-django111-drf{38,39},
|
||||
py{35,36}-django{111,21,22}-drf{38,39},
|
||||
py37-django{21,22}-drf{38,39,310},
|
||||
py38-django22-drf310,
|
||||
py36-django{111,22}-drf{38,39},
|
||||
py37-django22-drf{38,39,310,311},
|
||||
py38-django{22,3}-drf{310,311},
|
||||
djmaster, lint, docs
|
||||
skip_missing_interpreters = true
|
||||
|
||||
|
|
@ -20,21 +20,21 @@ deps =
|
|||
[testenv]
|
||||
deps =
|
||||
django111: Django>=1.11,<2.0
|
||||
django111: django-cors-headers>=2.1.0
|
||||
django111: django-oauth-toolkit>=1.1.0,<1.2.0
|
||||
|
||||
django21: Django>=2.1,<2.2
|
||||
django21: django-cors-headers>=2.1.0
|
||||
django21: django-oauth-toolkit>=1.2.0
|
||||
|
||||
django22: Django>=2.2,<2.3
|
||||
django22: django-cors-headers>=2.1.0
|
||||
django22: django-oauth-toolkit>=1.2.0
|
||||
django21: django-oauth-toolkit>=1.2.0
|
||||
|
||||
django3: Django>=2.2,<2.3
|
||||
django21: django-oauth-toolkit>=1.2.0
|
||||
|
||||
drf38: djangorestframework>=3.8,<3.9
|
||||
drf39: djangorestframework>=3.9,<3.10
|
||||
drf310: djangorestframework>=3.10
|
||||
drf310: djangorestframework>=3.10,<3.11
|
||||
drf311: djangorestframework>=3.11,<3.12
|
||||
|
||||
typing: typing>=3.6.6
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue