setup.py (1737B)
1 #!/usr/bin/env python3 2 3 import os 4 import re 5 6 from setuptools import setup, find_packages 7 8 PROJECT_ROOT = os.path.dirname(__file__) 9 10 with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_: 11 long_description = file_.read() 12 13 version_regex = r'__version__ = ["\']([^"\']*)["\']' 14 with open(os.path.join(PROJECT_ROOT, 'src/h2/__init__.py')) as file_: 15 text = file_.read() 16 match = re.search(version_regex, text) 17 if match: 18 version = match.group(1) 19 else: 20 raise RuntimeError("No version number found!") 21 22 setup( 23 name='h2', 24 version=version, 25 description='HTTP/2 State-Machine based protocol implementation', 26 long_description=long_description, 27 long_description_content_type='text/x-rst', 28 author='Cory Benfield', 29 author_email='cory@lukasa.co.uk', 30 url='https://github.com/python-hyper/h2', 31 packages=find_packages(where="src"), 32 package_data={'h2': []}, 33 package_dir={'': 'src'}, 34 python_requires='>=3.6.1', 35 license='MIT License', 36 classifiers=[ 37 'Development Status :: 5 - Production/Stable', 38 'Intended Audience :: Developers', 39 'License :: OSI Approved :: MIT License', 40 'Programming Language :: Python', 41 'Programming Language :: Python :: 3', 42 'Programming Language :: Python :: 3.6', 43 'Programming Language :: Python :: 3.7', 44 'Programming Language :: Python :: 3.8', 45 'Programming Language :: Python :: 3.9', 46 'Programming Language :: Python :: 3.10', 47 'Programming Language :: Python :: Implementation :: CPython', 48 'Programming Language :: Python :: Implementation :: PyPy', 49 ], 50 install_requires=[ 51 'hyperframe>=6.0,<7', 52 'hpack>=4.0,<5', 53 ], 54 )