From 8c6a4c7523910e0745ae06194fa9484e45feb190 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Mon, 21 Jan 2013 09:12:55 +0000 Subject: [PATCH] Add oslo-config project infrastructure --- .gitignore | 9 ++++++++ .gitreview | 4 ++++ README | 1 + oslo/__init__.py | 17 +++++++++++++++ oslo/config/__init__.py | 15 +++++++++++++ setup.py | 48 +++++++++++++++++++++++++++++++++++++++++ tests/__init__.py | 15 +++++++++++++ tools/pip-requires | 1 + tools/test-requires | 8 +++++++ tox.ini | 22 +++++++++++++++++++ 10 files changed, 140 insertions(+) create mode 100644 .gitignore create mode 100644 .gitreview create mode 100644 README create mode 100644 oslo/__init__.py create mode 100644 oslo/config/__init__.py create mode 100644 setup.py create mode 100644 tests/__init__.py create mode 100644 tools/pip-requires create mode 100644 tools/test-requires create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8471f1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*~ +*.swp +*.pyc +*.log +.tox +.coverage +oslo_config.egg-info/ +build/ +dist/ diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..1a4bd5d --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/oslo-config.git diff --git a/README b/README new file mode 100644 index 0000000..ce9556f --- /dev/null +++ b/README @@ -0,0 +1 @@ +Oslo configuration library. diff --git a/oslo/__init__.py b/oslo/__init__.py new file mode 100644 index 0000000..8aee389 --- /dev/null +++ b/oslo/__init__.py @@ -0,0 +1,17 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 Red Hat, Inc. +# +# 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. + +__import__('pkg_resources').declare_namespace(__name__) diff --git a/oslo/config/__init__.py b/oslo/config/__init__.py new file mode 100644 index 0000000..e5f41ad --- /dev/null +++ b/oslo/config/__init__.py @@ -0,0 +1,15 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 Red Hat, Inc. +# +# 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. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3f565be --- /dev/null +++ b/setup.py @@ -0,0 +1,48 @@ +#!/usr/bin/python + +# Copyright 2013 Red Hat, Inc. +# +# 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. + +import setuptools + +from magic.openstack.common import setup + +requires = setup.parse_requirements() +depend_links = setup.parse_dependency_links() +tests_require = setup.parse_requirements(['tools/test-requires']) + + +setuptools.setup( + name='oslo-config', + version=setup.get_post_version('oslo/config'), + description='Oslo configuration API', + long_description='The Oslo configuration API supports parsing command ' + 'line arguments and .ini style configuration files.', + classifiers=[ + 'Development Status :: 4 - Beta', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.6', ], + author='OpenStack', + author_email='openstack-dev@lists.openstack.org', + url='http://www.openstack.org/', + license='Apache Software License', + packages=['oslo.config', 'tests'], + namespace_packages=['oslo'], + install_requires=requires, + tests_require=tests_require, + setup_requires=['setuptools-git>=0.4'], + dependency_links=depend_links, +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e5f41ad --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,15 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2012 Red Hat, Inc. +# +# 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. diff --git a/tools/pip-requires b/tools/pip-requires new file mode 100644 index 0000000..1352d5e --- /dev/null +++ b/tools/pip-requires @@ -0,0 +1 @@ +argparse diff --git a/tools/test-requires b/tools/test-requires new file mode 100644 index 0000000..264047e --- /dev/null +++ b/tools/test-requires @@ -0,0 +1,8 @@ +mox +nose +nose-exclude + +# when we can require tox>= 1.4, this can go into tox.ini: +# [testenv:cover] +# deps = {[testenv]deps} coverage +coverage diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..bd066f6 --- /dev/null +++ b/tox.ini @@ -0,0 +1,22 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/tools/pip-requires + -r{toxinidir}/tools/test-requires +commands = nosetests --with-doctest --exclude-dir=tests/testmods {posargs} + +[testenv:pep8] +deps = pep8==1.3.3 +commands = pep8 --repeat --show-source --exclude=.tox,dist,*.egg --ignore=E125 . + +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 + +[testenv:venv] +commands = {posargs} + +[testenv:pyflakes] +deps = pyflakes +commands = pyflakes oslo setup.py