|
| 1 | +#!/usr/bin/env python |
| 2 | + |
| 3 | +import os |
| 4 | +import sys |
| 5 | + |
| 6 | +try: |
| 7 | + from setuptools import setup |
| 8 | +except ImportError: |
| 9 | + from distutils.core import setup |
| 10 | + |
| 11 | +# Get the version |
| 12 | +import re |
| 13 | +version_regex = r'__version__ = ["\']([^"\']*)["\']' |
| 14 | +with open('hyper/__init__.py', 'r') as f: |
| 15 | + text = f.read() |
| 16 | + match = re.search(version_regex, text) |
| 17 | + |
| 18 | + if match: |
| 19 | + version = match.group(1) |
| 20 | + else: |
| 21 | + raise RuntimeError("No version number found!") |
| 22 | + |
| 23 | +# Stealing this from Kenneth Reitz |
| 24 | +if sys.argv[-1] == 'publish': |
| 25 | + os.system('python setup.py sdist upload') |
| 26 | + sys.exit() |
| 27 | + |
| 28 | +packages = ['hyper'] |
| 29 | + |
| 30 | +setup( |
| 31 | + name='hyper', |
| 32 | + version=version, |
| 33 | + description='HTTP/2.0 for Python', |
| 34 | + long_description=open('README.rst').read(), |
| 35 | + author='Cory Benfield', |
| 36 | + |
| 37 | + url='', |
| 38 | + packages=packages, |
| 39 | + package_data={'': ['LICENSE', 'README.rst', 'CONTRIBUTORS.rst']}, |
| 40 | + package_dir={'hyper': 'hyper'}, |
| 41 | + include_package_data=True, |
| 42 | + license=open('LICENSE').read(), |
| 43 | + classifiers=( |
| 44 | + 'Development Status :: 3 - Alpha', |
| 45 | + 'Intended Audience :: Developers', |
| 46 | + 'License :: OSI Approved :: MIT License', |
| 47 | + 'Programming Language :: Python', |
| 48 | + 'Programming Language :: Python :: 3', |
| 49 | + 'Programming Language :: Python :: 3.3', |
| 50 | + ) |
| 51 | +) |
0 commit comments