Skip to content

Commit a89b61a

Browse files
committed
Support running flake8 in tox
1 parent 3220a96 commit a89b61a

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

kubernetes/client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def sanitize_for_serialization(self, obj):
193193
for sub_obj in obj]
194194
elif isinstance(obj, tuple):
195195
return tuple(self.sanitize_for_serialization(sub_obj)
196-
for sub_obj in obj)
196+
for sub_obj in obj)
197197
elif isinstance(obj, (datetime, date)):
198198
return obj.isoformat()
199199
else:

kubernetes/config/kube_config_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def test_load_kube_config(self):
542542
token=BEARER_TOKEN_FORMAT % TEST_DATA_BASE64)
543543
config_file = self._create_temp_file(yaml.dump(self.TEST_KUBE_CONFIG))
544544
actual = FakeConfig()
545-
load_kube_config(config_file=config_file,context="simple_token",
545+
load_kube_config(config_file=config_file, context="simple_token",
546546
client_configuration=actual)
547547
self.assertEqual(expected, actual)
548548

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pluggy>=0.3.1
44
py>=1.4.31
55
randomize>=0.13
66
mock>=2.0.0
7+
flake8>=2.5.4

tox.ini

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
[tox]
2-
envlist = py27, py34, py35
2+
minversion = 2.0
3+
envlist = py35,py34,py27,pep8
4+
skipsdist = True
35

46
[testenv]
5-
deps=-r{toxinidir}/requirements.txt
6-
-r{toxinidir}/test-requirements.txt
7-
7+
usedevelop = True
8+
install_command = pip install -U {opts} {packages}
9+
setenv =
10+
VIRTUAL_ENV={envdir}
11+
deps = -r{toxinidir}/test-requirements.txt
812
commands=
913
nosetests \
1014
[]
15+
16+
[testenv:pep8]
17+
commands = flake8 {posargs}
18+
19+
[testenv:venv]
20+
commands = {posargs}
21+
22+
[flake8]
23+
# E123, E125 skipped as they are invalid PEP-8.
24+
25+
show-source = True
26+
ignore = E123,E125,E127,E303,E501,F401,F841,H234,H304,H306,H404,H405,W292,W293
27+
builtins = _
28+
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build

0 commit comments

Comments
 (0)