From d3872aa9eeeb1b254c66c2de486d3815d1ca48ad Mon Sep 17 00:00:00 2001 From: Suhail Syed Date: Mon, 24 Aug 2015 05:37:37 -0700 Subject: [PATCH] Make Kolla installable via PIP Install Ansible code, etc file examples, scripts, an open rc example, a tool to initialize the OpenStack deployment, and other various useful bits. Start the versioning at 0.1.0 as recommended by ttx. Change-Id: I35fa4042040957e7725c7fc3b146009e0135499a Partially-Implements: blueprint python-package --- kolla/__init__.py | 22 +++++++++++++++ kolla/cmd/__init__.py | 0 {tools => kolla/cmd}/build.py | 0 requirements.txt | 1 + setup.cfg | 50 +++++++++++++++++++++++++++++++++++ setup.py | 29 ++++++++++++++++++++ tests/test_build.py | 2 +- 7 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 kolla/__init__.py create mode 100644 kolla/cmd/__init__.py rename {tools => kolla/cmd}/build.py (100%) create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/kolla/__init__.py b/kolla/__init__.py new file mode 100644 index 0000000000..8cc4759c03 --- /dev/null +++ b/kolla/__init__.py @@ -0,0 +1,22 @@ +# 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 threading + +import pbr.version + + +__version__ = pbr.version.VersionInfo( + 'kolla').version_string() + +# Make a project global TLS trace storage repository +TLS = threading.local() diff --git a/kolla/cmd/__init__.py b/kolla/cmd/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/build.py b/kolla/cmd/build.py similarity index 100% rename from tools/build.py rename to kolla/cmd/build.py diff --git a/requirements.txt b/requirements.txt index 4c7ccfae10..194ddbbd1a 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ +pbr<2.0,>=1.4 docker-py>=1.1.0 # Apache-2.0 Jinja2>=2.6 # BSD License (3 clause) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000..1e5d713056 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,50 @@ +[metadata] +name = kolla +version = 0.1.0 +summary = Kolla OpenStack Deployment +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = http://www.openstack.org/ +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 + +[files] +packages = + kolla +data_files = + share/kolla/ansible = ansible/* + share/kolla/devenv = devenv/* + share/kolla/docker = docker/* + share/kolla/docker_templates = docker_templates/* + share/kolla/docs = docs/* + share/kolla/etc_examples = etc/* + share/kolla/vagrant = vagrant/* + share/kolla = tools/init-runonce + share/kolla = tools/openrc-example + +scripts = + tools/kolla-ansible + +[entry_points] +console_scripts = + kolla-build = kolla.cmd.build:main + +[global] +setup-hooks = + pbr.hooks.setup_hook + +[pbr] + +[build_sphinx] +all_files = 1 +build-dir = doc/build +source-dir = docs diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000..d8080d05c8 --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +# 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 + +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa +except ImportError: + pass + +setuptools.setup( + setup_requires=['pbr>=1.3'], + pbr=True) diff --git a/tests/test_build.py b/tests/test_build.py index e83698c2cf..125c625406 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -19,7 +19,7 @@ from oslotest import base import sys sys.path.append(path.abspath(path.join(path.dirname(__file__), '../tools'))) -from tools import build +from kolla.cmd import build LOG = logging.getLogger(__name__)