/tools/third_party/hyperframe/setup.py

https://gitlab.com/Spagnotti3/wpt · Python · 59 lines · 48 code · 7 blank · 4 comment · 7 complexity · 2d6b257ae2567c7bac7d2fee9658b015 MD5 · raw file

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