mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Use flake8 under Tox and fix complaints
This commit is contained in:
parent
1f10529209
commit
dfd0868510
8 changed files with 34 additions and 12 deletions
15
.travis.yml
15
.travis.yml
|
@ -1,7 +1,14 @@
|
||||||
language: python
|
language: python
|
||||||
install: pip install tox pep8
|
|
||||||
python:
|
matrix:
|
||||||
- 2.7
|
include:
|
||||||
|
- python: 2.7
|
||||||
|
env: TOXENV=py27
|
||||||
|
- python: 2.7
|
||||||
|
env: TOXENV=lint
|
||||||
|
|
||||||
|
install:
|
||||||
|
- pip install tox
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- pep8 moulinette
|
|
||||||
- tox
|
- tox
|
||||||
|
|
|
@ -55,3 +55,11 @@ Requirements
|
||||||
* python-gnupg (>= 0.3)
|
* python-gnupg (>= 0.3)
|
||||||
* python-ldap (>= 2.4)
|
* python-ldap (>= 2.4)
|
||||||
* PyYAML
|
* PyYAML
|
||||||
|
|
||||||
|
Testing
|
||||||
|
-------
|
||||||
|
|
||||||
|
```
|
||||||
|
$ pip install tox
|
||||||
|
$ tox
|
||||||
|
```
|
||||||
|
|
|
@ -11,7 +11,7 @@ from gevent.queue import Queue
|
||||||
from geventwebsocket import WebSocketError
|
from geventwebsocket import WebSocketError
|
||||||
|
|
||||||
from bottle import run, request, response, Bottle, HTTPResponse
|
from bottle import run, request, response, Bottle, HTTPResponse
|
||||||
from bottle import get, post, install, abort, delete, put
|
from bottle import abort
|
||||||
|
|
||||||
from moulinette import msignals, m18n, DATA_DIR
|
from moulinette import msignals, m18n, DATA_DIR
|
||||||
from moulinette.core import MoulinetteError, clean_session
|
from moulinette.core import MoulinetteError, clean_session
|
||||||
|
|
|
@ -7,7 +7,6 @@ import locale
|
||||||
import logging
|
import logging
|
||||||
from argparse import SUPPRESS
|
from argparse import SUPPRESS
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import time
|
|
||||||
import pytz
|
import pytz
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import logging
|
||||||
|
|
||||||
# import all constants because other modules try to import them from this
|
# import all constants because other modules try to import them from this
|
||||||
# module because SUCCESS is defined in this module
|
# module because SUCCESS is defined in this module
|
||||||
from logging import (addLevelName, setLoggerClass, Logger, getLogger, NOTSET,
|
from logging import (addLevelName, setLoggerClass, Logger, getLogger, NOTSET, # noqa
|
||||||
DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[pep8]
|
[flake8]
|
||||||
ignore = E501,E128,E731
|
ignore = E501,E128,E731,E722
|
||||||
|
|
10
tox.ini
10
tox.ini
|
@ -1,5 +1,7 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py27
|
envlist =
|
||||||
|
py27
|
||||||
|
lint
|
||||||
skipdist = True
|
skipdist = True
|
||||||
isolated_build = True
|
isolated_build = True
|
||||||
|
|
||||||
|
@ -15,3 +17,9 @@ deps =
|
||||||
requests-mock >= 1.6.0, < 2.0
|
requests-mock >= 1.6.0, < 2.0
|
||||||
commands =
|
commands =
|
||||||
pytest {posargs}
|
pytest {posargs}
|
||||||
|
|
||||||
|
[testenv:lint]
|
||||||
|
commands = flake8 moulinette test
|
||||||
|
deps = flake8
|
||||||
|
skip_install = True
|
||||||
|
usedevelop = False
|
||||||
|
|
Loading…
Reference in a new issue