Skip to content

Commit

Permalink
[Tests] Replace isort test with flake8-isort
Browse files Browse the repository at this point in the history
 * Move the known_third_party back to setup.cfg with comments.
  • Loading branch information
cas-- committed Nov 25, 2016
1 parent 7ebd692 commit 8742496
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ env:
- TOX_ENV=pydef
- TOX_ENV=flake8
# - TOX_ENV=flake8-complexity
- TOX_ENV=isort
- TOX_ENV=docs
# - TOX_ENV=todo
- TOX_ENV=trial APTPACKAGES="$APTPACKAGES $APTPACKAGES_GTKUI"
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ frameworks = CoreFoundation, Foundation, AppKit

[isort]
known_standard_library = future_builtins
# Ignore Windows specific modules
known_third_party = bbfreeze, win32verstamp
known_third_party =
# Ignore Windows specific modules.
bbfreeze, win32verstamp,
# Ignore gtk modules, primarily for tox testing.
pygtk, gtk, gobject, gtk.gdk, pango, cairo, pangocairo
known_first_party = msgfmt, deluge
order_by_type = true
line_length = 120
Expand Down
19 changes: 3 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ max-line-length = 120
ignore = E301,E309

[tox]
envlist = py27, flake8, isort, docs, pylint
envlist = py27, flake8, docs, pylint
minversion=1.8

[testenv]
Expand Down Expand Up @@ -88,31 +88,18 @@ commands = {[testenv:pydef]commands}
# Code style verification
###########################

[testenv:isort]
deps =
{[testenv]deps}
isort>=4.2.5
whitelist_externals =
{[testenv]whitelist_externals}
isort
commands =
isort --version
python -c "import subprocess, sys; output = subprocess.check_output(\
'isort -q --diff --recursive deluge docs packaging *.py\
-o pygtk -o gtk -o gobject -o gtk.gdk -o pango -o cairo -o pangocairo\
', shell=True);\
print output; sys.exit(bool(output))"

[testenv:flake8]
# Disble site packages to avoid using system flake8 which uses hardcoded python path which imports the wrong libraries.
sitepackages = False
deps =
{[testenv]deps}
flake8
flake8-quotes
flake8-isort
pep8-naming
commands =
flake8 --version
python -c 'import isort; print(isort.__version__)'
flake8

[testenv:flake8-complexity]
Expand Down

0 comments on commit 8742496

Please sign in to comment.