Skip to content

Use flake8-isort to check isort #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ cache: pip
# Favor explicit over implicit and use an explicit build matrix.
matrix:
include:
- python: 3.6
env: TOXENV=flake8

- python: 2.7
env: TOXENV=py27-df11-django111-drf36
- python: 2.7
Expand Down Expand Up @@ -43,11 +46,6 @@ matrix:
env: TOXENV=py36-df20-django20-drf37
- python: 3.6
env: TOXENV=py36-df20-django20-drf38

- python: 3.6
env: TOXENV=flake8
- python: 3.6
env: TOXENV=isort
install:
- pip install tox
script:
Expand Down
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,18 @@ Running the example app
Browse to http://localhost:8000


Running Tests
^^^^^^^^^^^^^
Running Tests and linting
^^^^^^^^^^^^^^^^^^^^^^^^^

It is recommended to create a virtualenv for testing. Assuming it is already
installed and activated:

::

$ pip install -e .
$ pip install -r requirements-development.txt
$ flake8
$ py.test


-----
Usage
-----
Expand Down
2 changes: 1 addition & 1 deletion example/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import rest_framework.exceptions as exceptions
import rest_framework.parsers
import rest_framework.renderers
from django_filters import rest_framework as filters
from rest_framework.filters import SearchFilter

import rest_framework_json_api.metadata
import rest_framework_json_api.parsers
import rest_framework_json_api.renderers
from django_filters import rest_framework as filters
from rest_framework_json_api.django_filters import DjangoFilterBackend
from rest_framework_json_api.filters import OrderingFilter, QueryParameterValidationFilter
from rest_framework_json_api.pagination import PageNumberPagination
Expand Down
5 changes: 3 additions & 2 deletions requirements-development.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
-e .
django-debug-toolbar
django-filter>=2.0
django-polymorphic>=2.0
factory-boy
Faker
flake8
flake8-isort
isort
mock
pytest
Expand All @@ -11,6 +14,4 @@ pytest-factoryboy
recommonmark
Sphinx
sphinx_rtd_theme
tox
twine
django-filter>=2.0
4 changes: 2 additions & 2 deletions rest_framework_json_api/django_filters/backends.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import re

from django_filters import VERSION
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.exceptions import ValidationError
from rest_framework.settings import api_settings

from django_filters import VERSION
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework_json_api.utils import format_value


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ known_localfolder = example
known_standard_library = mock
line_length = 100
multi_line_output = 3
skip_glob=*migrations*
skip=migrations,.tox,docs/conf.py

[coverage:report]
omit=
Expand Down
13 changes: 2 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,9 @@ commands =
python setup.py test --addopts '--cov --no-cov-on-fail' {posargs}

[testenv:flake8]
deps = flake8
commands = flake8
skip_install = true

[testenv:isort]
deps =
isort
commands =
isort --check-only --verbose --recursive --diff rest_framework_json_api
# example has extra dependencies that are installed in a dev environment
# but are not installed in CI. Explicitly set those packages.
isort --check-only --verbose --recursive --diff --thirdparty pytest --thirdparty polymorphic --thirdparty pytest_factoryboy --thirdparty packaging example
-rrequirements-development.txt
commands = flake8

[testenv:sphinx]
deps =
Expand Down