Align build files and requirements

This is not an actual python project, so there is an amount of cruft
in the repo that is not needed. However, it does generate tarballs in
OpenStack Infra, so it needs the tox venv environment and the pbr
setup.py stuff. It also is totally possible to check python files in
the repo for flake8 violations, so set that up.

Change-Id: Ifb94f65912716efe1c4596d552beee92d2dc3d6a
This commit is contained in:
Monty Taylor 2013-08-17 23:50:41 -04:00
parent 0ea244d33a
commit ae5d0c61a3
7 changed files with 25 additions and 49 deletions

View File

@ -14,10 +14,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import itertools
import shlex import shlex
import subprocess import subprocess
import sys import sys
import itertools
warn_limit = 90 warn_limit = 90
crit_limit = 95 crit_limit = 95
@ -89,5 +89,5 @@ if not output_msg:
output_msg = "OK - All processes open files with in limits." output_msg = "OK - All processes open files with in limits."
exit_code = status['OK'] exit_code = status['OK']
print output_msg print(output_msg)
sys.exit(exit_code) sys.exit(exit_code)

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
pbr>=0.5.21,<1.0

View File

@ -4,11 +4,12 @@ version = 0.0.1
summary = Disk image builder elements for deploying OpenStack. summary = Disk image builder elements for deploying OpenStack.
description-file = description-file =
README.md README.md
author = HP Cloud Services author = OpenStack
author_email = openstack-dev@lists.openstack.org author_email = openstack-dev@lists.openstack.org
license: Apache License (2.0) license = Apache License (2.0)
home-page = https://github.com/openstack/tripleo-image-elements home-page = https://git.openstack.org/cgit/openstack/tripleo-image-elements
classifier = classifier =
Environment :: OpenStack
Development Status :: 3 - Alpha Development Status :: 3 - Alpha
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux Operating System :: POSIX :: Linux
@ -18,7 +19,3 @@ classifier =
[files] [files]
data_files = data_files =
share/tripleo-image-elements = elements/* share/tripleo-image-elements = elements/*
[global]
setup-hooks =
pbr.hooks.setup_hook

View File

@ -1,4 +1,5 @@
#!/usr/bin/python #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,8 +14,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools import setuptools
setuptools.setup( setuptools.setup(
setup_requires=['d2to1>=0.2.10,<0.3', 'pbr>=0.5.10,<0.6'], setup_requires=['pbr'],
d2to1=True) pbr=True)

1
test-requirements.txt Normal file
View File

@ -0,0 +1 @@
hacking>=0.5.6,<0.8

View File

@ -1,2 +0,0 @@
testtools
fixtures

47
tox.ini
View File

@ -1,43 +1,20 @@
[tox] [tox]
envlist = py26,py27,pep8 minversion = 1.6
skipsdist = True
envlist = pep8
[testenv] [testenv]
setenv = LANG=en_US.UTF-8 usedevelop = True
LANGUAGE=en_US:en deps = -r{toxinidir}/requirements.txt
LC_ALL=C -r{toxinidir}/test-requirements.txt
deps=
testtools
testrepository
coverage
babel
commands=
bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
bash -c 'testr run --parallel {posargs} ; RET=$? echo "Slowest Tests" ; testr slowest && exit $RET'
[testenv:py26]
deps=
testtools
testrepository
coverage
babel
discover
argparse
[pep8]
ignore = E125
[testenv:pep8]
deps = pep8
commands =
pep8 --repeat --show-source --exclude=.venv,.tox,doc .
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
[testenv:cover] [testenv:pep8]
setenv = PYTHON=coverage run --source tripleo_image_elements commands = flake8
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
bash -c 'testr run --parallel ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET'
[tox:jenkins] [flake8]
downloadcache = ~/cache/pip ignore = E125,H803
exclude = .venv,.tox,dist,doc,*.egg
show-source = true