setup.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import io
  2. import sys
  3. from setuptools import find_packages, setup
  4. from setuptools.command.test import test as TestCommand
  5. version = '1.1.0'
  6. # Please update tox.ini when modifying dependency version requirements
  7. install_requires = [
  8. # load_pem_private/public_key (>=0.6)
  9. # rsa_recover_prime_factors (>=0.8)
  10. 'cryptography>=0.8',
  11. # Connection.set_tlsext_host_name (>=0.13)
  12. 'PyOpenSSL>=0.13',
  13. # For pkg_resources. >=1.0 so pip resolves it to a version cryptography
  14. # will tolerate; see #2599:
  15. 'setuptools>=1.0',
  16. 'six>=1.9.0', # needed for python_2_unicode_compatible
  17. ]
  18. testing_requires = [
  19. 'coverage>=4.0',
  20. 'pytest-cache>=1.0',
  21. 'pytest-cov',
  22. 'flake8',
  23. 'pytest-flake8>=0.5',
  24. 'pytest>=2.8.0',
  25. 'mock',
  26. ]
  27. # env markers cause problems with older pip and setuptools
  28. if sys.version_info < (2, 7):
  29. install_requires.extend([
  30. 'argparse',
  31. 'ordereddict',
  32. ])
  33. dev_extras = [
  34. 'pytest',
  35. 'tox',
  36. ]
  37. docs_extras = [
  38. 'Sphinx>=1.0', # autodoc_member_order = 'bysource', autodoc_default_flags
  39. 'sphinx_rtd_theme',
  40. ]
  41. with io.open('README.rst', encoding='UTF-8') as f:
  42. long_description = f.read()
  43. class PyTest(TestCommand):
  44. user_options = []
  45. def initialize_options(self):
  46. TestCommand.initialize_options(self)
  47. self.pytest_args = ''
  48. def run_tests(self):
  49. import shlex
  50. # import here, cause outside the eggs aren't loaded
  51. import pytest
  52. errno = pytest.main(shlex.split(self.pytest_args))
  53. sys.exit(errno)
  54. setup(
  55. name='josepy',
  56. version=version,
  57. description='JOSE protocol implementation in Python',
  58. long_description=long_description,
  59. url='https://github.com/certbot/josepy',
  60. author="Certbot Project",
  61. author_email='client-dev@letsencrypt.org',
  62. license='Apache License 2.0',
  63. classifiers=[
  64. 'Development Status :: 3 - Alpha',
  65. 'Intended Audience :: Developers',
  66. 'License :: OSI Approved :: Apache Software License',
  67. 'Programming Language :: Python',
  68. 'Programming Language :: Python :: 2',
  69. 'Programming Language :: Python :: 2.6',
  70. 'Programming Language :: Python :: 2.7',
  71. 'Programming Language :: Python :: 3',
  72. 'Programming Language :: Python :: 3.3',
  73. 'Programming Language :: Python :: 3.4',
  74. 'Programming Language :: Python :: 3.5',
  75. 'Programming Language :: Python :: 3.6',
  76. 'Topic :: Internet :: WWW/HTTP',
  77. 'Topic :: Security',
  78. ],
  79. packages=find_packages(where='src'),
  80. package_dir={'': 'src'},
  81. include_package_data=True,
  82. install_requires=install_requires,
  83. extras_require={
  84. 'dev': dev_extras,
  85. 'docs': docs_extras,
  86. 'tests': testing_requires,
  87. },
  88. entry_points={
  89. 'console_scripts': [
  90. 'jws = josepy.jws:CLI.run',
  91. ],
  92. },
  93. tests_require=testing_requires,
  94. cmdclass={
  95. 'test': PyTest,
  96. },
  97. )