1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3import os 4import re 5import sys 6 7try: 8 from setuptools import setup 9except ImportError: 10 from distutils.core import setup 11 12# Get the version 13version_regex = r'__version__ = ["\']([^"\']*)["\']' 14with open('hpack/__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 24if sys.argv[-1] == 'publish': 25 os.system('python setup.py sdist upload') 26 sys.exit() 27 28packages = ['hpack'] 29 30setup( 31 name='hpack', 32 version=version, 33 description='Pure-Python HPACK header compression', 34 long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(), 35 author='Cory Benfield', 36 author_email='cory@lukasa.co.uk', 37 url='http://hyper.rtfd.org', 38 packages=packages, 39 package_data={'': ['LICENSE', 'README.rst', 'CONTRIBUTORS.rst', 'HISTORY.rst', 'NOTICES']}, 40 package_dir={'hpack': 'hpack'}, 41 include_package_data=True, 42 license='MIT License', 43 classifiers=[ 44 'Development Status :: 5 - Production/Stable', 45 'Intended Audience :: Developers', 46 'License :: OSI Approved :: MIT License', 47 'Programming Language :: Python', 48 'Programming Language :: Python :: 2', 49 'Programming Language :: Python :: 2.7', 50 'Programming Language :: Python :: 3', 51 'Programming Language :: Python :: 3.3', 52 'Programming Language :: Python :: 3.4', 53 'Programming Language :: Python :: 3.5', 54 'Programming Language :: Python :: 3.6', 55 'Programming Language :: Python :: Implementation :: CPython', 56 ], 57) 58