From 16c7b8aa19e04a1833d568c8ffde92e2c8945370 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sun, 7 Jul 2013 21:22:34 -0700 Subject: [PATCH] Move to using pbr. The new way to build packages and perform setuptools interactions seems to be via the pbr library so to play well with others, use said library. Change-Id: I519503fdf59457dc554870b8e6ff61613ab30d11 --- .gitignore | 5 ++++ MANIFEST.in | 7 ++++++ setup.cfg | 29 ++++++++++++++++++++++ setup.py | 60 ++++++++++++++------------------------------- tools/test-requires | 1 + 5 files changed, 60 insertions(+), 42 deletions(-) create mode 100644 MANIFEST.in diff --git a/.gitignore b/.gitignore index c93623a40..221bd42fc 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,8 @@ nosetests.xml # Modified Files *.swp + +# PBR +build +AUTHORS +ChangeLog diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..3eb7b33a5 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +include AUTHORS +include ChangeLog +exclude .gitignore +exclude .gitreview + +global-exclude *.pyc + diff --git a/setup.cfg b/setup.cfg index 071d4bf97..758024dff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,32 @@ +[metadata] +name = taskflow +version = 0.0.1 +summary = Taskflow structured state management library. +description-file = + README.md +author = Taskflow Developers +author-email = taskflow-dev@lists.launchpad.net +home-page = https://launchpad.net/taskflow +classifier = + Development Status :: 3 - Alpha + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: Developers + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.6 + Programming Language :: Python :: 2.7 + +[global] +setup-hooks = + pbr.hooks.setup_hook + +[files] +packages = + taskflow + [nosetests] cover-erase = true verbosity = 2 diff --git a/setup.py b/setup.py index 4c0cdfc7e..726cd9c6d 100644 --- a/setup.py +++ b/setup.py @@ -1,48 +1,24 @@ -#!/usr/bin/env python +# Copyright 2011 OpenStack Foundation +# +# 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 os import setuptools -def _clean_line(line): - line = line.strip() - line = line.split("#")[0] - line = line.strip() - return line - - -def read_requires(base): - path = os.path.join('tools', base) - requires = [] - if not os.path.isfile(path): - return requires - with open(path, 'rb') as h: - for line in h.read().splitlines(): - line = _clean_line(line) - if not line: - continue - requires.append(line) - return requires - - setuptools.setup( - name='taskflow', - version='0.0.1', - author='OpenStack', - license='Apache Software License', - description='Taskflow structured state management library.', - long_description='The taskflow library provides core functionality that ' - 'can be used to build [resumable, reliable, ' - 'easily understandable, ...] highly available ' - 'systems which process workflows in a structured manner.', - author_email='openstack-dev@lists.openstack.org', - url='http://www.openstack.org/', - packages=setuptools.find_packages(), - tests_require=read_requires('test-requires'), - install_requires=read_requires('pip-requires'), - classifiers=[ - 'Development Status :: 4 - Beta', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 2.6', ], + setup_requires=[ + 'd2to1>=0.2.10,<0.3', + 'pbr>=0.5,<0.6' + ], + d2to1=True ) diff --git a/tools/test-requires b/tools/test-requires index bd8b0aaf2..b37c80693 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -11,5 +11,6 @@ nose nose-exclude openstack.nose_plugin>=0.7 pylint==0.25.2 + # Needed for features in 2.7 not in 2.6 unittest2