Refactor setup requirements

openapi3
Cristi Vîjdea 2018-01-01 15:27:14 +01:00
parent 02b72c466e
commit 74fcd47047
7 changed files with 24 additions and 24 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
node_modules/ node_modules/
testproj/db.sqlite3
.vscode/
# Created by .ignore support plugin (hsz.mobi) # Created by .ignore support plugin (hsz.mobi)
### Python template ### Python template
@ -156,5 +158,3 @@ com_crashlytics_export_strings.xml
crashlytics.properties crashlytics.properties
crashlytics-build.properties crashlytics-build.properties
fabric.properties fabric.properties
testproj/db\.sqlite3

View File

@ -29,12 +29,12 @@ Features
- customization hooks at all points in the spec generation process - customization hooks at all points in the spec generation process
- JSON and YAML format for spec - JSON and YAML format for spec
- bundles latest version of - bundles latest version of
`swagger-ui <https://github.com/swagger-api/swagger-ui>`__ and `swagger-ui <https://github.com/swagger-api/swagger-ui>`_ and
`redoc <https://github.com/Rebilly/ReDoc>`__ for viewing the generated documentation `redoc <https://github.com/Rebilly/ReDoc>`_ for viewing the generated documentation
- schema view is cacheable out of the box - schema view is cacheable out of the box
- generated Swagger schema can be automatically validated by - generated Swagger schema can be automatically validated by
`swagger-spec-validator <https://github.com/Yelp/swagger_spec_validator>`__ or `swagger-spec-validator <https://github.com/Yelp/swagger_spec_validator>`_ or
`flex <https://github.com/pipermerriam/flex>`__ `flex <https://github.com/pipermerriam/flex>`_
.. figure:: https://raw.githubusercontent.com/axnsan12/drf-yasg/1.0.2/screenshots/redoc-nested-response.png .. figure:: https://raw.githubusercontent.com/axnsan12/drf-yasg/1.0.2/screenshots/redoc-nested-response.png
:width: 100% :width: 100%

View File

@ -199,8 +199,6 @@ nitpick_ignore = [
('py:obj', 'APIView'), ('py:obj', 'APIView'),
] ]
# TODO: inheritance aliases in sphinx 1.7
# even though the package should be already installed, the sphinx build on RTD # even though the package should be already installed, the sphinx build on RTD
# for some reason needs the sources dir to be in the path in order for viewcode to work # for some reason needs the sources dir to be in the path in order for viewcode to work
sys.path.insert(0, os.path.abspath('../src')) sys.path.insert(0, os.path.abspath('../src'))

View File

@ -7,5 +7,4 @@ isort>=4.2
flake8>=3.5.0 flake8>=3.5.0
flake8-isort>=2.3 flake8-isort>=2.3
# do not unpin this (see setup.py) -r setup.txt
setuptools_scm==1.15.6

View File

@ -0,0 +1,4 @@
# requirements for building the distributable package
# do not unpin this (see setup.py)
setuptools_scm==1.15.6

View File

@ -6,7 +6,18 @@ import os
import sys import sys
from setuptools import find_packages, setup from setuptools import find_packages, setup
requirements_setup = ['setuptools_scm==1.15.6']
def read_req(req_file):
with open(os.path.join('requirements', req_file)) as req:
return [line for line in req.readlines() if line and not line.isspace()]
with io.open('README.rst', encoding='utf-8') as readme:
description = readme.read()
requirements = ['djangorestframework>=3.7.0'] + read_req('base.txt')
requirements_setup = read_req('setup.txt')
requirements_validation = read_req('validation.txt')
def _install_setup_requires(attrs): def _install_setup_requires(attrs):
@ -40,18 +51,6 @@ if 'sdist' in sys.argv:
except ImportError: except ImportError:
pass pass
def read_req(req_file):
with open(os.path.join('requirements', req_file)) as req:
return [line for line in req.readlines() if line and not line.isspace()]
with io.open('README.rst', encoding='utf-8') as readme:
description = readme.read()
requirements = ['djangorestframework>=3.7.0'] + read_req('base.txt')
requirements_validation = read_req('validation.txt')
setup( setup(
name='drf-yasg', name='drf-yasg',
use_scm_version=True, use_scm_version=True,

View File

@ -59,7 +59,7 @@ max-line-length = 120
exclude = **/migrations/* exclude = **/migrations/*
[isort] [isort]
skip = .eggs,.tox,docs skip = .eggs,.tox,docs,env,venv
skip_glob = **/migrations/* skip_glob = **/migrations/*
not_skip = __init__.py not_skip = __init__.py
atomic = true atomic = true