Debian Codegraph @

testing/web-platform/tests/tools/third_party/hpack/setup.py

raw
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 import codecs
4 import os
5 import re
6 import sys
7
8 from setuptools import setup, find_packages
9
10 PROJECT_ROOT = os.path.dirname(__file__)
11
12 with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_:
13 long_description = file_.read()
14
15 # Get the version
16 version_regex = r'__version__ = ["\']([^"\']*)["\']'
17 with open(os.path.join(PROJECT_ROOT, 'src/hpack/__init__.py')) as file_:
18 text = file_.read()
19 match = re.search(version_regex, text)
20
21 if match:
22 version = match.group(1)
23 else:
24 raise RuntimeError("No version number found!")
25
26 # Stealing this from Kenneth Reitz
27 if sys.argv[-1] == 'publish':
28 os.system('python setup.py sdist upload')
29 sys.exit()
30
31 setup(
32 name='hpack',
33 version=version,
34 description='Pure-Python HPACK header compression',
35 long_description=long_description,
36 long_description_content_type='text/x-rst',
37 author='Cory Benfield',
38 author_email='[email protected]',
39 url='https://github.com/python-hyper/hpack',
40 packages=find_packages(where="src"),
41 package_data={'': ['LICENSE', 'README.rst', 'CHANGELOG.rst']},
42 package_dir={'': 'src'},
43 python_requires='>=3.6.1',
44 include_package_data=True,
45 license='MIT License',
46 classifiers=[
47 'Development Status :: 5 - Production/Stable',
48 'Intended Audience :: Developers',
49 'License :: OSI Approved :: MIT License',
50 'Programming Language :: Python',
51 'Programming Language :: Python :: 3',
52 'Programming Language :: Python :: 3.6',
53 'Programming Language :: Python :: 3.7',
54 'Programming Language :: Python :: 3.8',
55 'Programming Language :: Python :: Implementation :: CPython',
56 'Programming Language :: Python :: Implementation :: PyPy',
57 ],
58 )