summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Olsen <billy.olsen@gmail.com>2017-03-13 16:18:42 -0700
committerBilly Olsen <billy.olsen@gmail.com>2017-03-13 16:22:14 -0700
commitfd3fad022d37b803ba053644e345343367d4880e (patch)
tree2bb6751a7b3e98f71e7fc95f5d72c5251413220a
parent8e58c99777b62651c31512cc795b3651efb4cc99 (diff)
Fix pep8 for setup.py
Commit 195d002ab added a setup.py to the charms.ceph library for inclusion in the pypi repositories. The setup.py file included was not lint checked and introduces pep8 violations which are checked in dependent projects (charm-ceph-osd, charm-ceph-mon, etc). This change fixes the pep8 linting and also adds the setup.py file to the tox configuration file to prevent future issues. Change-Id: Ic84d3348023e8fa968638be935af9b5d31806ef1
Notes
Notes (review): Code-Review+2: Chris Holcombe <chris.holcombe@canonical.com> Workflow+1: Chris Holcombe <chris.holcombe@canonical.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 14 Mar 2017 03:36:11 +0000 Reviewed-on: https://review.openstack.org/445239 Project: openstack/charms.ceph Branch: refs/heads/master
-rw-r--r--setup.py10
-rw-r--r--tox.ini2
2 files changed, 9 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index f5d5911..139c80d 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,7 @@
1# -*- coding: utf-8 -*- 1# -*- coding: utf-8 -*-
2from __future__ import print_function 2from __future__ import print_function
3 3
4import os
4import sys 5import sys
5from setuptools import setup, find_packages 6from setuptools import setup, find_packages
6from setuptools.command.test import test as TestCommand 7from setuptools.command.test import test as TestCommand
@@ -13,17 +14,22 @@ tests_require = [
13 'tox >= 2.3.1', 14 'tox >= 2.3.1',
14] 15]
15 16
17
16class Tox(TestCommand): 18class Tox(TestCommand):
19
17 user_options = [('tox-args=', 'a', "Arguments to pass to tox")] 20 user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
21
18 def initialize_options(self): 22 def initialize_options(self):
19 TestCommand.initialize_options(self) 23 TestCommand.initialize_options(self)
20 self.tox_args = None 24 self.tox_args = None
25
21 def finalize_options(self): 26 def finalize_options(self):
22 TestCommand.finalize_options(self) 27 TestCommand.finalize_options(self)
23 self.test_args = [] 28 self.test_args = []
24 self.test_suite = True 29 self.test_suite = True
30
25 def run_tests(self): 31 def run_tests(self):
26 #import here, cause outside the eggs aren't loaded 32 # import here, cause outside the eggs aren't loaded
27 import tox 33 import tox
28 import shlex 34 import shlex
29 args = self.tox_args 35 args = self.tox_args
@@ -70,7 +76,7 @@ setup(
70 license='Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0', 76 license='Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0',
71 packages=find_packages(exclude=["unit_tests"]), 77 packages=find_packages(exclude=["unit_tests"]),
72 zip_safe=False, 78 zip_safe=False,
73 cmdclass = {'test': Tox}, 79 cmdclass={'test': Tox},
74 install_requires=install_require, 80 install_requires=install_require,
75 extras_require={ 81 extras_require={
76 'testing': tests_require, 82 'testing': tests_require,
diff --git a/tox.ini b/tox.ini
index c469224..88fa4d9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -32,7 +32,7 @@ deps = -r{toxinidir}/requirements.txt
32basepython = python2.7 32basepython = python2.7
33deps = -r{toxinidir}/requirements.txt 33deps = -r{toxinidir}/requirements.txt
34 -r{toxinidir}/test-requirements.txt 34 -r{toxinidir}/test-requirements.txt
35commands = flake8 {posargs} ceph unit_tests 35commands = flake8 {posargs} ceph unit_tests setup.py
36 36
37[testenv:venv] 37[testenv:venv]
38commands = {posargs} 38commands = {posargs}