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
This commit is contained in:
Billy Olsen 2017-03-13 16:18:42 -07:00
parent 8e58c99777
commit fd3fad022d
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
@ -13,17 +14,22 @@ tests_require = [
'tox >= 2.3.1',
]
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
# import here, cause outside the eggs aren't loaded
import tox
import shlex
args = self.tox_args
@ -70,7 +76,7 @@ setup(
license='Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0',
packages=find_packages(exclude=["unit_tests"]),
zip_safe=False,
cmdclass = {'test': Tox},
cmdclass={'test': Tox},
install_requires=install_require,
extras_require={
'testing': tests_require,

View File

@ -32,7 +32,7 @@ deps = -r{toxinidir}/requirements.txt
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = flake8 {posargs} ceph unit_tests
commands = flake8 {posargs} ceph unit_tests setup.py
[testenv:venv]
commands = {posargs}