Setup and install improvements
* Cleaned up setup.py post install * Moved version from cloudroast init to setup.py Change-Id: If32781cd4e13a06d202bc8795999ac7bdbf685df
This commit is contained in:
parent
0367060a11
commit
a89ab7ef5f
@ -15,8 +15,6 @@ limitations under the License.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'cloudroast'
|
__title__ = 'cloudroast'
|
||||||
__version__ = '0.0.1'
|
|
||||||
#__build__ = 0x010100
|
|
||||||
__author__ = 'Rackspace Cloud QE'
|
__author__ = 'Rackspace Cloud QE'
|
||||||
__license__ = 'Internal Only'
|
__license__ = 'Apache License Version 2.0'
|
||||||
__copyright__ = 'Copyright 2013 Rackspace Inc.'
|
__copyright__ = 'Copyright 2013 Rackspace Inc.'
|
||||||
|
61
setup.py
61
setup.py
@ -17,11 +17,13 @@ limitations under the License.
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import cloudroast
|
|
||||||
try:
|
try:
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
from setuptools.command.install import install as _install
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup, find_packages
|
from distutils.core import setup, find_packages
|
||||||
|
from distutils.command.install import install as _install
|
||||||
|
|
||||||
|
|
||||||
if sys.argv[-1] == 'publish':
|
if sys.argv[-1] == 'publish':
|
||||||
os.system('python setup.py sdist upload')
|
os.system('python setup.py sdist upload')
|
||||||
@ -29,9 +31,31 @@ if sys.argv[-1] == 'publish':
|
|||||||
|
|
||||||
requires = open('pip-requires').readlines()
|
requires = open('pip-requires').readlines()
|
||||||
|
|
||||||
|
|
||||||
|
#Post-install engine configuration
|
||||||
|
def _post_install(dir):
|
||||||
|
print('\n'.join(["\t\t (----) (----)--)",
|
||||||
|
"\t\t (--(----) (----) --)",
|
||||||
|
"\t\t (----) (--(----) (----)",
|
||||||
|
"\t\t -----------------------",
|
||||||
|
"\t\t \ /",
|
||||||
|
"\t\t \ /",
|
||||||
|
"\t\t \_________________/",
|
||||||
|
"\t\t === CloudRoast ===",
|
||||||
|
"\t\t= A CloudCAFE Test Repository ="]))
|
||||||
|
|
||||||
|
|
||||||
|
#cmdclass hook allows setup to make post install call
|
||||||
|
class install(_install):
|
||||||
|
def run(self):
|
||||||
|
_install.run(self)
|
||||||
|
self.execute(
|
||||||
|
_post_install, (self.install_lib,),
|
||||||
|
msg="Running post install tasks...")
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='cloudroast',
|
name='cloudroast',
|
||||||
version=cloudroast.__version__,
|
version='0.0.1',
|
||||||
description='CloudCAFE based automated test repository for OpenStack',
|
description='CloudCAFE based automated test repository for OpenStack',
|
||||||
long_description='{0}\n\n{1}'.format(
|
long_description='{0}\n\n{1}'.format(
|
||||||
open('README.md').read(),
|
open('README.md').read(),
|
||||||
@ -46,7 +70,6 @@ setup(
|
|||||||
install_requires=requires,
|
install_requires=requires,
|
||||||
license=open('LICENSE').read(),
|
license=open('LICENSE').read(),
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
#https://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/specification.html
|
|
||||||
classifiers=(
|
classifiers=(
|
||||||
'Development Status :: 1 - Planning',
|
'Development Status :: 1 - Planning',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
@ -55,33 +78,5 @@ setup(
|
|||||||
'Operating System :: POSIX :: Linux',
|
'Operating System :: POSIX :: Linux',
|
||||||
'Programming Language :: Python',
|
'Programming Language :: Python',
|
||||||
'Programming Language :: Python :: 2.6',
|
'Programming Language :: Python :: 2.6',
|
||||||
'Programming Language :: Python :: 2.7',
|
'Programming Language :: Python :: 2.7',),
|
||||||
)
|
cmdclass={'install': install})
|
||||||
)
|
|
||||||
|
|
||||||
''' @todo: need to clean this up or do it with puppet/chef '''
|
|
||||||
# Default Config Options
|
|
||||||
root_dir = "{0}/.cloudcafe".format(os.path.expanduser("~"))
|
|
||||||
config_dir = "{0}/configs".format(root_dir)
|
|
||||||
|
|
||||||
# Build Default directories
|
|
||||||
if(os.path.exists("{0}/engine.config".format(config_dir)) == False):
|
|
||||||
raise Exception("Core CAFE Engine configuration not found")
|
|
||||||
else:
|
|
||||||
# Copy over the default configurations
|
|
||||||
if(os.path.exists("~install")):
|
|
||||||
os.remove("~install")
|
|
||||||
# Report
|
|
||||||
print('\n'.join(["\t\t (----) (----)--)",
|
|
||||||
"\t\t (--(----) (----) --)",
|
|
||||||
"\t\t (----) (--(----) (----)",
|
|
||||||
"\t\t -----------------------",
|
|
||||||
"\t\t \ /",
|
|
||||||
"\t\t \ /",
|
|
||||||
"\t\t \_________________/",
|
|
||||||
"\t\t === CloudRoast ===",
|
|
||||||
"\t\t= A CloudCAFE Test Repository ="]))
|
|
||||||
else:
|
|
||||||
# State file
|
|
||||||
temp = open("~install", "w")
|
|
||||||
temp.close()
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user