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:
parent
8e58c99777
commit
fd3fad022d
10
setup.py
10
setup.py
|
@ -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,
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue