fix pep8 and py27

Change-Id: Ie58d3d43505cdb599444eb9eab4bee28bbaf8eed
Signed-off-by: Thiago da Silva <thiago@redhat.com>
This commit is contained in:
Thiago da Silva 2015-09-10 14:22:24 +00:00
parent fe386a67aa
commit 1164a57616
7 changed files with 44 additions and 15 deletions

View File

@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: eNovance <dev@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at

View File

View File

@ -1,8 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Babu Shanmugam <anbu@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at

View File

@ -1,8 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Babu Shanmugam <anbu@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at

19
test-requirements.txt Normal file
View File

@ -0,0 +1,19 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
# Hacking already pins down pep8, pyflakes and flake8
hacking>=0.10.0,<0.11
coverage
nose
nosexcover
nosehtmloutput
oslosphinx
sphinx>=1.1.2,<1.2
mock>=1.0
python-swiftclient
python-keystoneclient>=1.3.0
# Security checks
bandit>=0.10.1

View File

@ -1,8 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Babu Shanmugam <anbu@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at

32
tox.ini
View File

@ -1,13 +1,15 @@
[tox]
envlist = py26,py27,pep8
envlist = py27,pep8
minversion = 1.6
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
#install_command = pip install {opts} {packages}
install_command = pip install --allow-external netifaces --allow-insecure netifaces -U {opts} {packages}
deps =
https://launchpad.net/swift/icehouse/1.13.1/+download/swift-1.13.1.tar.gz
https://launchpad.net/swift/liberty/2.4.0/+download/swift-2.4.0.tar.gz
-r{toxinidir}/test-requirements.txt
commands = nosetests {posargs:tests}
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
@ -20,7 +22,9 @@ setenv = VIRTUAL_ENV={envdir}
NOSE_COVER_BRANCHES=1
[testenv:pep8]
commands = flake8
commands =
flake8 {posargs:swift_ceph_backend tests setup.py}
[testenv:venv]
commands = {posargs}
@ -37,7 +41,21 @@ downloadcache = ~/cache/pip
[flake8]
# follow the same style guidelines with swift
ignore = H
select = H102,H103,H201,H501,H903
exclude = .venv,.git,.tox,dist,doc,*egg,build
# it's not a bug that we aren't using all of hacking, ignore:
# F812: list comprehension redefines ...
# H101: Use TODO(NAME)
# H202: assertRaises Exception too broad
# H233: Python 3.x incompatible use of print operator
# H234: assertEquals is deprecated, use assertEqual
# H301: one import per line
# H306: imports not in alphabetical order (time, os)
# H401: docstring should not start with a space
# H403: multi line docstrings should end on a new line
# H404: multi line docstring should start without a leading new line
# H405: multi line docstring summary not separated with an empty line
# H501: Do not use self.__dict__ for string formatting
# H703: Multiple positional placeholders
ignore = F812,H101,H202,H233,H234,H301,H306,H401,H403,H404,H405,H501,H703
exclude = .venv,.tox,dist,doc,*egg
show-source = True