Skip to content

Commit 1808ed8

Browse files
author
Clark Perkins
committed
Added travis, fixed pep8 / pylint errors
1 parent df08398 commit 1808ed8

File tree

13 files changed

+322
-80
lines changed

13 files changed

+322
-80
lines changed

.travis.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
language: python
2+
3+
python:
4+
- "2.7"
5+
- "3.2"
6+
- "3.3"
7+
- "3.4"
8+
- "3.5"
9+
10+
cache:
11+
directories:
12+
- $HOME/.cache/pip
13+
14+
# Set up our environment
15+
env:
16+
NOSE_WITH_XUNIT: 1
17+
NOSE_WITH_COVERAGE: 1
18+
NOSE_COVER_BRANCHES: 1
19+
NOSE_COVER_INCLUSIVE: 1
20+
DJANGO_SETTINGS_MODULE: stackdio.server.settings.testing
21+
22+
# So that we get a docker container
23+
sudo: false
24+
25+
## Customize dependencies
26+
install:
27+
- pip install -U pip
28+
- pip install -U wheel
29+
- pip install -U -e .[testing]
30+
31+
## Customize test commands
32+
before_script:
33+
- pep8 stackdio/ && echo 'Finished PEP-8 Check Cleanly' || echo 'Finished PEP-8 Check With Errors'
34+
- pylint stackdio/ && echo 'Finished Pylint Check Cleanly' || echo 'Finished Pylint Check With Errors'
35+
36+
# Nothing to do here yet
37+
script:
38+
- date
39+
40+
# Only build artifacts on success
41+
after_success:
42+
- coveralls
43+
- export STACKDIO_VERSION=`python setup.py --version`
44+
- python setup.py sdist
45+
- python setup.py bdist_wheel
46+
47+
deploy:
48+
provider: releases
49+
api_key:
50+
secure: dJIj78Kl5nvtE2OpYl2I4ICEw20kLVXyr+eGOcWVV3kbU+PS6zKqOtLM+sGuVYNSbqWviRR9um6zbzjqS3S2wjFOdeStMogo19EKepSc0S97t6BkmbH0KooFuFah/YFOzLu+UBzDa3EETvgd1/988Eoojr0Ea2kZRJcvx/S0vDI=
51+
file:
52+
- dist/stackdio-server-${STACKDIO_VERSION}.tar.gz
53+
- dist/stackdio_server-${STACKDIO_VERSION}-py2.py3-none-any.whl
54+
skip_cleanup: true
55+
on:
56+
tags: true
57+
repo: stackdio/stackdio

pylintrc

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
[MASTER]
2+
3+
# Python code to execute, usually for sys.path manipulation such as
4+
# pygtk.require().
5+
init-hook="
6+
exec 'aW1wb3J0IG9zLCBzeXMKCmlmICdWSVJUVUFMX0VOVicgaW4gb3MuZW52aXJvbjoKCiAgICB2ZV9k \
7+
aXIgPSBvcy5lbnZpcm9uWydWSVJUVUFMX0VOViddCiAgICB2ZV9kaXIgaW4gc3lzLnBhdGggb3Ig \
8+
c3lzLnBhdGguaW5zZXJ0KDAsIHZlX2RpcikKICAgIGFjdGl2YXRlX3RoaXMgPSBvcy5wYXRoLmpv \
9+
aW4ob3MucGF0aC5qb2luKHZlX2RpciwgJ2JpbicpLCAnYWN0aXZhdGVfdGhpcy5weScpCgogICAg \
10+
IyBGaXggZm9yIHdpbmRvd3MKICAgIGlmIG5vdCBvcy5wYXRoLmV4aXN0cyhhY3RpdmF0ZV90aGlz \
11+
KToKICAgICAgICBhY3RpdmF0ZV90aGlzID0gb3MucGF0aC5qb2luKG9zLnBhdGguam9pbih2ZV9k \
12+
aXIsICdTY3JpcHRzJyksICdhY3RpdmF0ZV90aGlzLnB5JykKCiAgICBleGVjZmlsZShhY3RpdmF0 \
13+
ZV90aGlzLCBkaWN0KF9fZmlsZV9fPWFjdGl2YXRlX3RoaXMpKQo='.decode('base64')"
14+
# Pickle collected data for later comparisons.
15+
persistent=no
16+
17+
#ignore=
18+
19+
#load-plugins=
20+
21+
[MESSAGES CONTROL]
22+
23+
# Enable the message, report, category or checker with the given id(s). You can
24+
# either give multiple identifier separated by comma (,) or put this option
25+
# multiple time. See also the "--disable" option for examples.
26+
#enable=E0001,E0100,E0101,E0102,E0103,E0104,E0105,E0106,E0107,E0108,E0202,E0203,E0211,E0213,E0221,E0222,E0601,E0602,E0603,E0604,E0701,E0702,E0710,E0711,E1001,E1002,E1003,E1102,E1111,E1120,E1121,E1122,E1123,E1124,E1200,E1201,E1205,E1206,E1300,E1301,E1302,E1303,E1304,E1305,E1306,E1310,C0112,C0121,C0202,C0321,C0322,C0323,C0324,W0101,W0102,W0104,W0105,W0106,W0107,W0108,W0109,W0120,W0141,W0150,W0199,W0211,W0221,W0222,W0223,W0231,W0232,W0233,W0301,W0311,W0312,W0331,W0332,W0333,W0401,W0402,W0403,W0406,W0410,W0601,W0602,W0604,W0614,W0623,W0701,W0702,W0703,W0710,W0711,W1001,W1111,W1201,W1300,W1301,W1401,W1402,F0202
27+
28+
# Disable the message, report, category or checker with the given id(s). You
29+
# can either give multiple identifiers separated by comma (,) or put this
30+
# option multiple times (only on the command line, not in the configuration
31+
# file where it should appear only once).You can also use "--disable=all" to
32+
# disable everything first and then reenable specific checks. For example, if
33+
# you want to run only the similarities checker, you can use "--disable=all
34+
# --enable=similarities". If you want to run only the classes checker, but have
35+
# no Warning level messages displayed, use"--disable=all --enable=classes
36+
# --disable=W"
37+
disable=R,
38+
I0011,
39+
I0013,
40+
E1101,
41+
E1103,
42+
C0102,
43+
C0103,
44+
C0111,
45+
C0203,
46+
C0204,
47+
C0302,
48+
C0330,
49+
C1001,
50+
W0110,
51+
W0122,
52+
W0142,
53+
W0201,
54+
W0212,
55+
W0231,
56+
W0232,
57+
W0404,
58+
W0511,
59+
W0603,
60+
W0612,
61+
W0613,
62+
W0621,
63+
W0622,
64+
W0631,
65+
W0704,
66+
F0220,
67+
E8121,
68+
E8122,
69+
E8123,
70+
E8124,
71+
E8125,
72+
E8126,
73+
E8127,
74+
E8128,
75+
E8129,
76+
E8131,
77+
E8265
78+
79+
# Disabled:
80+
# R* [refactoring suggestions & reports]
81+
# I0011 (locally-disabling)
82+
# I0013 (file-ignored)
83+
# E1101 (no-member) [pylint isn't smart enough]
84+
# E1103 (maybe-no-member)
85+
# C0102 (blacklisted-name) [because it activates C0103 too]
86+
# C0103 (invalid-name)
87+
# C0111 (missing-docstring)
88+
# C0203 (bad-mcs-method-argument)
89+
# C0204 (bad-mcs-classmethod-argument)
90+
# C0302 (too-many-lines)
91+
# C0330 (bad-continuation)
92+
# C1001 (old-style-class) [Way to many Meta inner classes that don't need it]
93+
# W0110 (deprecated-lambda)
94+
# W0122 (exec-statement)
95+
# W0142 (star-args)
96+
# W0201 (attribute-defined-outside-init) [done in several places in the codebase]
97+
# W0212 (protected-access)
98+
# W0231 (super-init-not-called) [this doesn't play well with our mixins]
99+
# W0232 (no-init) [classes missing __init__ method - several Meta classes that don't need it]
100+
# W0404 (reimported) [done intentionally for legit reasons]
101+
# W0511 (fixme) [several outstanding instances currently in the codebase]
102+
# W0603 (global-statement)
103+
# W0612 (unused-variable) [unused return values]
104+
# W0613 (unused-argument)
105+
# W0621 (redefined-outer-name)
106+
# W0622 (redefined-builtin) [many parameter names shadow builtins]
107+
# W0631 (undefined-loop-variable) [~3 instances, seem to be okay]
108+
# W0704 (pointless-except) [misnomer; "ignores the exception" rather than "pointless"]
109+
# F0220 (unresolved-interface)
110+
#
111+
# E812* All PEP8 E12*
112+
# E8265 PEP8 E265 - block comment should start with "# "
113+
114+
[REPORTS]
115+
116+
# Tells whether to display a full report or only the messages
117+
reports=no
118+
119+
# Set the output format. Available formats are text, parseable, colorized, msvs
120+
# (visual studio) and html
121+
# output-format=parseable
122+
msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}'
123+
124+
# Put messages in a separate file for each module / package specified on the
125+
# command line instead of printing them on stdout. Reports (if any) will be
126+
# written in a file name "pylint_global.[txt|html]".
127+
files-output=no
128+
129+
130+
[BASIC]
131+
132+
# List of builtins function names that should not be used, separated by a comma
133+
bad-functions=apply,input
134+
135+
136+
[FORMAT]
137+
# Maximum number of characters on a single line.
138+
max-line-length=120
139+
140+
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
141+
# tab).
142+
indent-string=' '
143+
144+
145+
[VARIABLES]
146+
147+
# List of additional names supposed to be defined in builtins. Remember that
148+
# you should avoid to define new builtins when possible.
149+
#additional-builtins=
150+
151+
152+
[IMPORTS]
153+
154+
# Deprecated modules which should not be used, separated by a comma
155+
deprecated-modules=regsub,TERMIOS,Bastion,rexec
156+
157+
158+
[EXCEPTIONS]
159+
160+
# Exceptions that will emit a warning when being caught. Defaults to
161+
# "Exception"
162+
overgeneral-exceptions=BaseException

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
# 3. If at all possible, it is good practice to do this. If you cannot, you
44
# will need to generate wheels for each Python version that you support.
55
universal=1
6+
7+
[pep8]
8+
9+
max-line-length=100
10+
ignore=E501,E12

setup.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def test_python_version():
5454
'simplejson==3.4.0',
5555
]
5656

57+
testing_requirements = [
58+
'coveralls',
59+
'pep8',
60+
'pylint<=1.2.0',
61+
]
62+
5763
if __name__ == "__main__":
5864
test_python_version()
5965

@@ -81,6 +87,9 @@ def test_python_version():
8187
zip_safe=False,
8288
install_requires=requirements,
8389
dependency_links=[],
90+
extras_require={
91+
'testing': testing_requirements,
92+
},
8493
entry_points={
8594
'console_scripts': [
8695
'stackdio-cli=stackdio.cli:main',

stackdio/cli/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
from __future__ import print_function
4+
35
import argparse
46
import json
57
import os
@@ -29,14 +31,14 @@ class StackdioShell(
2931
PROMPT = "\n{username} @ {url}\n> "
3032
HELP_CMDS = [
3133
"account_summary",
32-
"stacks", "blueprints", "formulas",
33-
"initial_setup", "bootstrap",
34+
"stacks", "blueprints", "formulas",
35+
"initial_setup", "bootstrap",
3436
"help", "exit", "quit",
3537
]
3638

3739
Cmd.intro = """
3840
######################################################################
39-
s t a c k d . i o
41+
s t a c k d . i o
4042
######################################################################
4143
"""
4244

@@ -69,7 +71,7 @@ def _init_stacks(self):
6971
self.stacks = StackdIO(
7072
base_url=self.config["url"],
7173
auth=(
72-
self.config["username"],
74+
self.config["username"],
7375
keyring.get_password(self.KEYRING_SERVICE, self.config.get("username") or "")
7476
),
7577
verify=self.config.get('verify', True)
@@ -133,7 +135,7 @@ def _setprompt(self):
133135
Cmd.prompt = self.colorize(
134136
self.PROMPT.format(**self.config),
135137
"blue")
136-
138+
137139
if not self.validated and self.config['url'] is not None:
138140
print(self.colorize("""
139141
##
@@ -142,7 +144,7 @@ def _setprompt(self):
142144
## 'initial_setup' to configure your account details. If you've already
143145
## done that, there could be a network connection issue anywhere between
144146
## your computer and your stackd.io instance,
145-
## or your password may be incorrect, or ... etc.
147+
## or your password may be incorrect, or ... etc.
146148
##
147149
""",
148150
"green"))
@@ -155,7 +157,7 @@ def _setprompt(self):
155157
def _print_summary(self, title, components):
156158
num_components = len(components)
157159
print("## {0} {1}{2}".format(
158-
num_components,
160+
num_components,
159161
title,
160162
"s" if num_components == 0 or num_components > 1 else ""))
161163

@@ -183,7 +185,7 @@ def do_account_summary(self, args=None):
183185

184186
print("## Username: {0}".format(self.config["username"]))
185187
print("## Public Key:\n{0}".format(public_key))
186-
188+
187189
self._print_summary("Formula", formulas)
188190
self._print_summary("Blueprint", blueprints)
189191
self._print_summary("Stack", stacks)

stackdio/cli/blueprints/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import print_function
2+
13
import argparse
24
import os
35
import json
@@ -53,4 +55,4 @@ def main():
5355
main()
5456
except KeyboardInterrupt:
5557
sys.stderr.write('Aborting...\n')
56-
sys.exit(1)
58+
sys.exit(1)

0 commit comments

Comments
 (0)