setup.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. try:
  6. from setuptools import setup
  7. except ImportError:
  8. from distutils.core import setup
  9. from mozilla_django_oidc import __version__ as VERSION
  10. if sys.argv[-1] == 'publish':
  11. try:
  12. import wheel
  13. print('Wheel version: ', wheel.__version__)
  14. except ImportError:
  15. print('Wheel library missing. Please run "pip install wheel"')
  16. sys.exit()
  17. os.system('python setup.py sdist upload')
  18. os.system('python setup.py bdist_wheel upload')
  19. sys.exit()
  20. if sys.argv[-1] == 'tag':
  21. print('Tagging the version on git:')
  22. os.system("git tag -a %s -m 'version %s'" % (VERSION, VERSION))
  23. os.system('git push --tags')
  24. sys.exit()
  25. readme = open('README.rst').read()
  26. history = open('HISTORY.rst').read().replace('.. :changelog:', '')
  27. install_requirements = [
  28. 'Django>1.7',
  29. 'josepy',
  30. 'requests'
  31. ]
  32. # cryptography dropped supporting Python 3.2/3.3 at some point
  33. if sys.version_info[:2] > (2, 7) and sys.version_info[:2] < (3, 4):
  34. install_requirements.append('cryptography<1.9')
  35. else:
  36. install_requirements.append('cryptography>1.9')
  37. setup(
  38. name='mozilla-django-oidc',
  39. version=VERSION,
  40. description="""A lightweight authentication and access management library for integration with OpenID Connect enabled authentication services.""", # noqa
  41. long_description=readme + '\n\n' + history,
  42. author='Tasos Katsoulas, John Giannelos',
  43. author_email='akatsoulas@mozilla.com, jgiannelos@mozilla.com',
  44. url='https://github.com/mozilla/mozilla-django-oidc',
  45. packages=['mozilla_django_oidc'],
  46. include_package_data=True,
  47. install_requires=install_requirements,
  48. license='MPL 2.0',
  49. zip_safe=False,
  50. keywords='mozilla-django-oidc',
  51. classifiers=[
  52. 'Development Status :: 3 - Alpha',
  53. 'Framework :: Django',
  54. 'Framework :: Django :: 1.8',
  55. 'Framework :: Django :: 1.11',
  56. 'Framework :: Django :: 2.0',
  57. 'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
  58. 'Intended Audience :: Developers',
  59. 'Operating System :: MacOS',
  60. 'Operating System :: POSIX :: Linux',
  61. 'Natural Language :: English',
  62. 'Programming Language :: Python :: 2',
  63. 'Programming Language :: Python :: 2.7',
  64. 'Programming Language :: Python :: 3',
  65. 'Programming Language :: Python :: 3.3',
  66. 'Programming Language :: Python :: 3.4',
  67. 'Programming Language :: Python :: 3.5',
  68. 'Programming Language :: Python :: 3.6',
  69. ],
  70. )