Add support for Tox

Change-Id: I6974c78e15e34cbe1ce28b2f43525dd267b814e4
This commit is contained in:
Christian Berendt 2014-08-06 14:07:01 +02:00
parent 548aac7d25
commit b2b77d6cd1
7 changed files with 137 additions and 1 deletions

24
.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
.DS_Store
.venv
# Packages
*.py[cod]
*.egg
*.egg-info
dist
build
eggs
sdist
# Unit test / coverage reports
.coverage
.tox
# pbr generates these
AUTHORS
ChangeLog
# Editors
*~
.*.swp
.bak

View File

@ -67,7 +67,8 @@ def gen_url(title, foreach, sections):
def get_options():
parser = argparse.ArgumentParser(
description='Create a gerrit dashboard URL from a dashboard definition')
description='Create a gerrit dashboard URL from a dashboard '
'definition')
parser.add_argument('dash',
metavar='dashboard_file',
help="Dashboard file to create url from")

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
argparse
pbr>=0.6,!=0.7,<1.0

42
setup.cfg Normal file
View File

@ -0,0 +1,42 @@
[metadata]
name = gerrit-dash-creator
summary = Gerrit Dashboard Creator
description-file =
README.rst
author = OpenStack
author-email = openstack-dev@lists.openstack.org
home-page = https://github.com/stackforge/gerrit-dash-creator/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2.6
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
[global]
setup-hooks =
pbr.hooks.setup_hook
[files]
packages =
gerrit_dash_creator
data_files =
share/gerrit-dash-creator = dashboards/*
[entry_points]
console_scripts =
gerrit-dash-creator = gerrit_dash_creator.cmd.creator:main
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html

22
setup.py Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True)

11
test-requirements.txt Normal file
View File

@ -0,0 +1,11 @@
hacking>=0.9.2,<0.10
coverage>=3.6
discover
fixtures>=0.3.14
python-subunit
sphinx>=1.1.2
oslosphinx
testrepository>=0.0.17
testscenarios>=0.4,<0.5
testtools>=0.9.32

34
tox.ini Normal file
View File

@ -0,0 +1,34 @@
[tox]
minversion = 1.6
envlist = py33,py26,py27,pypy,pep8
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx
[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125,H803
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build