|
| 1 | +import os |
| 2 | +import sys |
| 3 | + |
| 4 | +from setuptools import setup, find_packages |
| 5 | +from pip.req import parse_requirements |
| 6 | + |
| 7 | + |
| 8 | +def test_python_version(): |
| 9 | + if float("%d.%d" % sys.version_info[:2]) < 2.6: |
| 10 | + print('Your Python version {0}.{1}.{2} is not supported.'.format( |
| 11 | + *sys.version_info[:3])) |
| 12 | + print('stackdio requires Python 2.6 or newer.') |
| 13 | + sys.exit(1) |
| 14 | + |
| 15 | + |
| 16 | +def load_pip_requirements(fp): |
| 17 | + reqs, deps = [], [] |
| 18 | + for r in parse_requirements(fp): |
| 19 | + if r.url is not None: |
| 20 | + deps.append(str(r.url)) |
| 21 | + reqs.append(str(r.req)) |
| 22 | + return reqs, deps |
| 23 | + |
| 24 | +# Set version |
| 25 | +__version__ = '0.0.0' # Explicit default |
| 26 | +execfile("stackdio/client/version.py") |
| 27 | + |
| 28 | + |
| 29 | +SHORT_DESCRIPTION = ('A cloud deployment, automation, and orchestration ' |
| 30 | + 'platform for everyone.') |
| 31 | +LONG_DESCRIPTION = SHORT_DESCRIPTION |
| 32 | + |
| 33 | +# If we have a README.md file, use its contents as the long description |
| 34 | +if os.path.isfile('README.md'): |
| 35 | + with open('README.md') as f: |
| 36 | + LONG_DESCRIPTION = f.read() |
| 37 | + |
| 38 | + |
| 39 | +if __name__ == "__main__": |
| 40 | + # build our list of requirements and dependency links based on our |
| 41 | + # requirements.txt file |
| 42 | + reqs, deps = load_pip_requirements('requirements.txt') |
| 43 | + |
| 44 | + # Call the setup method from setuptools that does all the heavy lifting |
| 45 | + # of packaging stackdio |
| 46 | + setup( |
| 47 | + name='stackdio', |
| 48 | + version=__version__, |
| 49 | + url='http://stackd.io', |
| 50 | + author='Digital Reasoning Systems, Inc.', |
| 51 | + author_email='info@stackd.io', |
| 52 | + description=SHORT_DESCRIPTION, |
| 53 | + long_description=LONG_DESCRIPTION, |
| 54 | + license='Apache 2.0', |
| 55 | + include_package_data=True, |
| 56 | + packages=find_packages(), |
| 57 | + zip_safe=False, |
| 58 | + install_requires=reqs, |
| 59 | + dependency_links=deps, |
| 60 | + classifiers=[ |
| 61 | + 'Development Status :: 3 - Alpha', |
| 62 | + 'Environment :: Web Environment', |
| 63 | + 'Framework :: Django', |
| 64 | + 'Intended Audience :: Developers', |
| 65 | + 'Intended Audience :: Information Technology', |
| 66 | + 'Intended Audience :: System Administrators', |
| 67 | + 'License :: OSI Approved :: Apache Software License', |
| 68 | + 'Programming Language :: Python', |
| 69 | + 'Programming Language :: Python :: 2.6', |
| 70 | + 'Programming Language :: Python :: 2.7', |
| 71 | + 'Topic :: System :: Clustering', |
| 72 | + 'Topic :: System :: Distributed Computing', |
| 73 | + ] |
| 74 | + ) |
0 commit comments