From 4438058c8188e1104563fd7e88af4c21e903f30b Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 13 Aug 2013 13:44:58 -0300 Subject: [PATCH] Updated to OpenStack standards Change-Id: Idf87a63c72bfb85de713ebb69564509f8c00393b --- .gitignore | 2 ++ README.md | 5 ----- README.rst | 5 +++++ requirements.txt | 1 + setup.cfg | 30 ++++++++++++++++++++++++++ setup.py | 42 ++++++++++++++++++------------------- test-requirements.txt | 11 ++++++++++ tox.ini | 49 +++++++++++++++++-------------------------- 8 files changed, 88 insertions(+), 57 deletions(-) delete mode 100644 README.md create mode 100644 README.rst create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 test-requirements.txt diff --git a/.gitignore b/.gitignore index 5ce6616..639821b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ dist build *.egg-info +AUTHORS +ChangeLog diff --git a/README.md b/README.md deleted file mode 100644 index 34d7a11..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Runs through all of the phases to ensure configuration is applied -and enabled on a machine. Will exit with an error if any phase has a -problem. Scripts should not depend on eachother having worked properly. -Set `OS_REFRESH_CONFIG_BASE_DIR` environment variable to override -the default diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..cfea169 --- /dev/null +++ b/README.rst @@ -0,0 +1,5 @@ +Runs through all of the phases to ensure configuration is applied and +enabled on a machine. Will exit with an error if any phase has a +problem. Scripts should not depend on eachother having worked properly. +Set ``OS_REFRESH_CONFIG_BASE_DIR`` environment variable to override the +default diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4e46b89 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pbr>=0.5.21,<1.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..bc51f2f --- /dev/null +++ b/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +name = os-refresh-config +author = OpenStack +author-email = openstack-dev@lists.openstack.org +summary = Refresh system configuration +description-file = + README.rst +home-page = http://github.com/stackforge/os-refresh-config +classifier = + Development Status :: 4 - Beta + Environment :: Console + Environment :: OpenStack + Intended Audience :: Developers + Intended Audience :: Information Technology + License :: OSI Approved :: Apache Software License + Operating System :: OS Independent + Programming Language :: Python + +[files] +packages = + os_refresh_config + +[entry_points] +console_scripts = + os-refresh-config = os_refresh_config.os_refresh_config:main + +[egg_info] +tag_build = +tag_date = 0 +tag_svn_revision = 0 diff --git a/setup.py b/setup.py index 3ba5bdb..2a0786a 100755 --- a/setup.py +++ b/setup.py @@ -1,24 +1,22 @@ -#!/usr/bin/python -try: - from setuptools import setup -except ImportError: - from distutils.core import setup +#!/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. -config = { - 'name': 'os-refresh-config', - 'description': 'refreshes system configuration', - 'author': 'SpamapS', - 'author_email': 'clint@fewbar.com', - 'url': 'http://github.com/tripleo/os-refresh-config', - 'version': '0.5', - 'packages': ['os_refresh_config'], - 'scripts': [], - 'long_description': open('README.md', 'rb').read(), - 'packages': ['os_refresh_config'], - 'entry_points': { - 'console_scripts': [ - 'os-refresh-config = os_refresh_config.os_refresh_config:main'] - } -} +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools -setup(**config) +setuptools.setup( + setup_requires=['pbr>=0.5.21,<1.0'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..e367839 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,11 @@ +hacking>=0.5.6,<0.7 + +Babel>=0.9.6 +coverage>=3.6 +discover +fixtures>=0.3.12 +python-subunit +sphinx>=1.1.2 +testrepository>=0.0.17 +testscenarios>=0.4,<0.5 +testtools>=0.9.32 diff --git a/tox.ini b/tox.ini index 31023a8..88cce83 100644 --- a/tox.ini +++ b/tox.ini @@ -1,43 +1,32 @@ [tox] -envlist = py26,py27,pep8 +envlist = py27,pep8 [testenv] -setenv = LANG=en_US.UTF-8 +setenv = VIRTUAL_ENV={envdir} + LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=C -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' +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = + python setup.py testr --slowest --testr-args='{posargs}' -[testenv:py26] -deps= - testtools - testrepository - coverage - babel - discover - argparse - -[pep8] -ignore = E125 +[tox:jenkins] +sitepackages = True +downloadcache = ~/cache/pip [testenv:pep8] -deps = pep8 +commands = flake8 + +[testenv:cover] +setenv = VIRTUAL_ENV={envdir} commands = - pep8 --repeat --show-source --exclude=.venv,.tox,doc . + python setup.py testr --coverage [testenv:venv] commands = {posargs} -[testenv:cover] -setenv = PYTHON=coverage run --source os_refresh_config -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] -downloadcache = ~/cache/pip +[flake8] +ignore = E125,H803 +exclude = .venv,.tox,dist,doc,*.egg,./os_collect_config/openstack/* +show-source = true