Skip to content

Commit

Permalink
Split requirements files up following DRF example
Browse files Browse the repository at this point in the history
Fixes #712
Fixes #635

This way not all dependency need to be installed for the different
testing steps.
  • Loading branch information
sliverc committed Oct 10, 2019
1 parent 7655f02 commit ed10e03
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 31 deletions.
14 changes: 13 additions & 1 deletion .pyup.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
search: False
requirements:
- requirements-development.txt:
- requirements/requirements-codestyle.txt:
update: all
pin: True
- requirements/requirements-documentation.txt:
update: all
pin: True
- requirements/requirements-optionals.txt:
update: all
pin: True
- requirements/requirements-packaging.txt:
update: all
pin: True
- requirements/requirements-testing.txt:
update: all
pin: True
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ matrix:

include:
- python: 3.6
env: TOXENV=flake8
env: TOXENV=lint
- python: 3.6
env: TOXENV=docs

- python: 3.5
env: TOXENV=py35-django111-drf310
Expand Down
5 changes: 2 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ installed and activated:

$ git clone https://github.com/django-json-api/django-rest-framework-json-api.git
$ cd django-rest-framework-json-api
$ pip install -r example/requirements.txt
$ pip install -e .
$ pip install -U -e . -r requirements.txt
$ django-admin migrate --settings=example.settings
$ django-admin loaddata drf_example --settings=example.settings
$ django-admin runserver --settings=example.settings
Expand All @@ -145,7 +144,7 @@ installed and activated:

::

$ pip install -Ur requirements-development.txt
$ pip install -Ur requirements.txt
$ flake8
$ pytest

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
django.setup()

# Auto-generate API documentation.
main(['-o', '_build/apidoc', '-f', '-e', '-T', '-M', '../rest_framework_json_api'])
main(['-o', 'apidoc', '-f', '-e', '-T', '-M', '../rest_framework_json_api'])

# -- General configuration ------------------------------------------------

Expand Down
3 changes: 1 addition & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ From Source
cd django-rest-framework-json-api
python3 -m venv env
source env/bin/activate
pip install -r example/requirements.txt
pip install -e .
pip install -U -e . r requirements.txt
django-admin migrate --settings=example.settings
django-admin loaddata drf_example --settings=example.settings
django-admin runserver --settings=example.settings
Expand Down
16 changes: 0 additions & 16 deletions requirements-development.txt

This file was deleted.

14 changes: 13 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@

# The base set of requirements for Django REST framework JSON API is actually
# fairly small, but for the purposes of development and testing
# there are a number of packages that are useful to install.

# Laying these out as separate requirements files, allows us to
# only included the relevant sets when running tox, and ensures
# we are only ever declaring our dependencies in one place.

-r requirements/requirements-optionals.txt
-r requirements/requirements-testing.txt
-r requirements/requirements-documentation.txt
-r requirements/requirements-codestyle.txt
-r requirements/requirements-packaging.txt
3 changes: 3 additions & 0 deletions requirements/requirements-codestyle.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flake8==3.7.7
flake8-isort==2.7.0
isort==4.3.21
3 changes: 3 additions & 0 deletions requirements/requirements-documentation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recommonmark==0.6.0
Sphinx==2.2.0
sphinx_rtd_theme==0.4.3
2 changes: 2 additions & 0 deletions requirements/requirements-optionals.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
django-filter==2.2.0
django-polymorphic==2.1.2
1 change: 1 addition & 0 deletions requirements/requirements-packaging.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
twine==2.0.0
7 changes: 7 additions & 0 deletions requirements/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
django-debug-toolbar==2.0
factory-boy==2.12.0
Faker==2.0.2
pytest==5.2.1
pytest-cov==2.8.1
pytest-django==3.5.1
pytest-factoryboy==2.0.3
18 changes: 12 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
envlist =
py{35,36}-django111-drf{310,master},
py{35,36,37}-django{21,22}-drf{310,master},
lint,docs

[testenv]
deps =
Expand All @@ -10,7 +11,8 @@ deps =
django22: Django>=2.2,<2.3
drf310: djangorestframework>=3.10.2,<3.11
drfmaster: https://github.com/encode/django-rest-framework/archive/master.zip
-rrequirements-development.txt
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt

setenv =
PYTHONPATH = {toxinidir}
Expand All @@ -19,15 +21,19 @@ setenv =
commands =
pytest --cov --no-cov-on-fail --cov-report xml {posargs}

[testenv:flake8]
[testenv:lint]
basepython = python3.6
deps =
-rrequirements-development.txt
-rrequirements/requirements-codestyle.txt
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
commands = flake8

[testenv:sphinx]
[testenv:docs]
basepython = python3.6
deps =
-rrequirements-development.txt
-rrequirements/requirements-testing.txt
-rrequirements/requirements-optionals.txt
-rrequirements/requirements-documentation.txt
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html

0 comments on commit ed10e03

Please sign in to comment.