setup.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. from __future__ import absolute_import
  2. import codecs
  3. import os
  4. import re
  5. from setuptools import setup
  6. def get_version(filename):
  7. with codecs.open(filename, 'r', 'utf-8') as fp:
  8. contents = fp.read()
  9. return re.search(r"__version__ = ['\"]([^'\"]+)['\"]", contents).group(1)
  10. version = get_version(os.path.join('corsheaders', '__init__.py'))
  11. with codecs.open('README.rst', 'r', 'utf-8') as readme_file:
  12. readme = readme_file.read()
  13. with codecs.open('HISTORY.rst', 'r', 'utf-8') as history_file:
  14. history = history_file.read()
  15. setup(
  16. name='django-cors-headers',
  17. version=version,
  18. description=(
  19. 'django-cors-headers is a Django application for handling the server '
  20. 'headers required for Cross-Origin Resource Sharing (CORS).'
  21. ),
  22. long_description=readme + '\n\n' + history,
  23. author='Otto Yiu',
  24. author_email='otto@live.ca',
  25. url='https://github.com/ottoyiu/django-cors-headers',
  26. packages=['corsheaders'],
  27. license='MIT License',
  28. keywords=['django', 'cors', 'middleware', 'rest', 'api'],
  29. install_requires=[
  30. 'Django>=1.11',
  31. ],
  32. python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
  33. classifiers=[
  34. 'Development Status :: 5 - Production/Stable',
  35. 'Environment :: Web Environment',
  36. 'Framework :: Django',
  37. 'Framework :: Django :: 1.11',
  38. 'Framework :: Django :: 2.0',
  39. 'Framework :: Django :: 2.1',
  40. 'Framework :: Django :: 2.2',
  41. 'Intended Audience :: Developers',
  42. 'License :: OSI Approved :: MIT License',
  43. 'Operating System :: OS Independent',
  44. 'Programming Language :: Python',
  45. 'Programming Language :: Python :: 2',
  46. 'Programming Language :: Python :: 2.7',
  47. 'Programming Language :: Python :: 3',
  48. 'Programming Language :: Python :: 3.5',
  49. 'Programming Language :: Python :: 3.6',
  50. 'Programming Language :: Python :: 3.7',
  51. 'Topic :: Software Development :: Libraries :: Application Frameworks',
  52. 'Topic :: Software Development :: Libraries :: Python Modules',
  53. ],
  54. )