setup.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from __future__ import with_statement
  4. import re
  5. import os
  6. import sys
  7. # While I generally consider it an antipattern to try and support both
  8. # setuptools and distutils with a single setup.py, in this specific instance
  9. # where certifi is a dependency of setuptools, it can create a circular
  10. # dependency when projects attempt to unbundle stuff from setuptools and pip.
  11. # Though we don't really support that, it makes things easier if we do this and
  12. # should hopefully cause less issues for end users.
  13. try:
  14. from setuptools import setup
  15. except ImportError:
  16. from distutils.core import setup
  17. version_regex = r'__version__ = ["\']([^"\']*)["\']'
  18. with open('certifi/__init__.py', 'r') as f:
  19. text = f.read()
  20. match = re.search(version_regex, text)
  21. if match:
  22. VERSION = match.group(1)
  23. else:
  24. raise RuntimeError("No version number found!")
  25. if sys.argv[-1] == 'publish':
  26. os.system('python setup.py sdist bdist_wheel upload')
  27. sys.exit()
  28. required = []
  29. setup(
  30. name='certifi',
  31. version=VERSION,
  32. description='Python package for providing Mozilla\'s CA Bundle.',
  33. long_description=open('README.rst').read(),
  34. author='Kenneth Reitz',
  35. author_email='me@kennethreitz.com',
  36. url='http://certifi.io/',
  37. packages=[
  38. 'certifi',
  39. ],
  40. package_dir={'certifi': 'certifi'},
  41. package_data={'certifi': ['*.pem']},
  42. # data_files=[('certifi', ['certifi/cacert.pem'])],
  43. include_package_data=True,
  44. zip_safe=False,
  45. license='MPL-2.0',
  46. classifiers=(
  47. 'Development Status :: 5 - Production/Stable',
  48. 'Intended Audience :: Developers',
  49. 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
  50. 'Natural Language :: English',
  51. 'Programming Language :: Python',
  52. 'Programming Language :: Python :: 2',
  53. 'Programming Language :: Python :: 2.6',
  54. 'Programming Language :: Python :: 2.7',
  55. 'Programming Language :: Python :: 3',
  56. 'Programming Language :: Python :: 3.3',
  57. 'Programming Language :: Python :: 3.4',
  58. 'Programming Language :: Python :: 3.5',
  59. 'Programming Language :: Python :: 3.6',
  60. ),
  61. )