Merge pull request #276 from axnsan12/pyproject-pep518
Add pyproject.toml (implement PEP517 and PEP518)master
commit
8974aa5734
11
.travis.yml
11
.travis.yml
|
|
@ -15,18 +15,20 @@ jobs:
|
|||
python: '3.7'
|
||||
dist: xenial
|
||||
sudo: required
|
||||
-
|
||||
python: '3.6'
|
||||
- python: '3.6'
|
||||
env: TOXENV=djmaster
|
||||
- # readthedocs uses python 3.5 for building
|
||||
python: '3.5'
|
||||
env: TOXENV=docs
|
||||
-
|
||||
python: '3.6'
|
||||
- python: '3.6'
|
||||
env: TOXENV=lint
|
||||
|
||||
- stage: publish
|
||||
python: '3.6'
|
||||
before_script:
|
||||
# workaround for Travis' inability to build PEP517 projects; anything added to build-system.requires
|
||||
# will also have to be added here until Travis implements this
|
||||
- pip install setuptools-scm
|
||||
script: skip
|
||||
env: PYPI_DEPLOY=true
|
||||
deploy: &pypi
|
||||
|
|
@ -45,6 +47,7 @@ jobs:
|
|||
fast_finish: true
|
||||
|
||||
install:
|
||||
- python -m pip install -U pip setuptools
|
||||
- pip install -r requirements/ci.txt
|
||||
|
||||
before_script:
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
|||
|
||||
$ virtualenv venv
|
||||
$ source venv/bin/activate
|
||||
(venv) $ python -m pip install -U pip setuptools
|
||||
(venv) $ pip install -U -e .[validation]
|
||||
(venv) $ pip install -U -r requirements/dev.txt
|
||||
|
||||
|
|
@ -57,8 +58,7 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
|||
|
||||
.. code:: console
|
||||
|
||||
(venv) $ cd testproj
|
||||
(venv) $ python 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.
|
||||
|
|
@ -67,13 +67,13 @@ You want to contribute some code? Great! Here are a few steps to get you started
|
|||
|
||||
.. code:: console
|
||||
|
||||
# (optional) sort imports with isort and check flake8 linting
|
||||
(venv) $ isort --apply
|
||||
(venv) $ flake8 src/drf_yasg testproj tests setup.py
|
||||
# install test dependencies
|
||||
(venv) $ pip install -U -r requirements/test.txt
|
||||
# run tests in the current environment, faster than tox
|
||||
(venv) $ pytest -n auto --cov
|
||||
# (optional) sort imports with isort and check flake8 linting
|
||||
(venv) $ isort --apply
|
||||
(venv) $ flake8 src/drf_yasg testproj tests setup.py
|
||||
# (optional) run tests for other python versions in separate environments
|
||||
(venv) $ tox
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
include README.rst
|
||||
include LICENSE.rst
|
||||
include pyproject.toml
|
||||
recursive-include requirements *
|
||||
recursive-include src/drf_yasg/static *
|
||||
recursive-include src/drf_yasg/templates *
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ In ``urls.py``:
|
|||
...
|
||||
]
|
||||
|
||||
This exposes 4 cached, validated and publicly available endpoints:
|
||||
This exposes 4 endpoints:
|
||||
|
||||
* A JSON view of your API specification at ``/swagger.json``
|
||||
* A YAML view of your API specification at ``/swagger.yaml``
|
||||
|
|
@ -294,6 +294,7 @@ For additional usage examples, you can take a look at the test project in the ``
|
|||
$ virtualenv venv
|
||||
$ source venv/bin/activate
|
||||
(venv) $ cd testproj
|
||||
(venv) $ python -m pip install -U pip setuptools
|
||||
(venv) $ pip install -U -r requirements.txt
|
||||
(venv) $ python manage.py migrate
|
||||
(venv) $ python manage.py shell -c "import createsuperuser"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
[build-system]
|
||||
requires = ["setuptools", "wheel", "setuptools-scm"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
-r requirements/setup.txt
|
||||
# this file is only used when deploying to heroku, because heroku insists on having a root-level requirements.txt
|
||||
# for normal usage see the requirements/ directory
|
||||
.[validation]
|
||||
-r requirements/heroku.txt
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
Sphinx>=1.7.0
|
||||
sphinx_rtd_theme>=0.2.4
|
||||
Pillow>=4.3.0
|
||||
readme_renderer>=17.2
|
||||
readme_renderer[md]>=24.0
|
||||
twine>=1.12.1
|
||||
|
||||
Django>=2.0
|
||||
djangorestframework_camel_case>=0.2.0
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
# needed to build the package setup_requires in setup.py
|
||||
|
||||
setuptools-scm>=3.0.6
|
||||
|
|
@ -1,4 +1,2 @@
|
|||
# requirements for building and running tox
|
||||
tox>=3.1.2
|
||||
|
||||
-r setup.txt
|
||||
tox>=3.3.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
python-3.6.7
|
||||
python-3.7.1
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -17,7 +17,6 @@ with io.open('README.rst', encoding='utf-8') as readme:
|
|||
description = readme.read()
|
||||
|
||||
requirements = read_req('base.txt')
|
||||
requirements_setup = read_req('setup.txt')
|
||||
requirements_validation = read_req('validation.txt')
|
||||
|
||||
|
||||
|
|
@ -28,7 +27,6 @@ def drf_yasg_setup(**kwargs):
|
|||
package_dir={'': 'src'},
|
||||
include_package_data=True,
|
||||
install_requires=requirements,
|
||||
setup_requires=requirements_setup,
|
||||
extras_require={
|
||||
'validation': requirements_validation,
|
||||
},
|
||||
|
|
|
|||
11
tox.ini
11
tox.ini
|
|
@ -1,11 +1,18 @@
|
|||
[tox]
|
||||
# https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
|
||||
minversion = 3.3.0
|
||||
isolated_build = true
|
||||
isolated_build_env=.package
|
||||
envlist =
|
||||
py{27,34,35,36}-django111-drf{37,38,39},
|
||||
py{34,35,36,37}-django20-drf{37,38,39},
|
||||
py{35,36,37}-django21-drf{37,38,39},
|
||||
djmaster, lint, docs
|
||||
|
||||
[testenv:.package]
|
||||
# no additional dependencies besides PEP 517
|
||||
deps =
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
django111: Django>=1.11,<2.0
|
||||
|
|
@ -21,7 +28,6 @@ deps =
|
|||
djmaster: https://github.com/django/django/archive/master.tar.gz
|
||||
|
||||
# other dependencies
|
||||
-rrequirements/setup.txt
|
||||
-r requirements/validation.txt
|
||||
-r requirements/test.txt
|
||||
|
||||
|
|
@ -37,10 +43,9 @@ commands =
|
|||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
-rrequirements/setup.txt
|
||||
-r requirements/docs.txt
|
||||
commands =
|
||||
python setup.py check --restructuredtext --metadata --strict
|
||||
twine check .tox/dist/*
|
||||
sphinx-build -WnEa -b html docs docs/_build/html
|
||||
|
||||
[pytest]
|
||||
|
|
|
|||
Loading…
Reference in New Issue