setup.py 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import os
  2. import sys
  3. from distutils.sysconfig import get_python_lib
  4. from setuptools import find_packages, setup
  5. # Warn if we are installing over top of an existing installation. This can
  6. # cause issues where files that were deleted from a more recent Django are
  7. # still present in site-packages. See #18115.
  8. overlay_warning = False
  9. if "install" in sys.argv:
  10. lib_paths = [get_python_lib()]
  11. if lib_paths[0].startswith("/usr/lib/"):
  12. # We have to try also with an explicit prefix of /usr/local in order to
  13. # catch Debian's custom user site-packages directory.
  14. lib_paths.append(get_python_lib(prefix="/usr/local"))
  15. for lib_path in lib_paths:
  16. existing_path = os.path.abspath(os.path.join(lib_path, "django"))
  17. if os.path.exists(existing_path):
  18. # We note the need for the warning here, but present it after the
  19. # command is run, so it's more likely to be seen.
  20. overlay_warning = True
  21. break
  22. EXCLUDE_FROM_PACKAGES = ['django.conf.project_template',
  23. 'django.conf.app_template',
  24. 'django.bin']
  25. # Dynamically calculate the version based on django.VERSION.
  26. version = __import__('django').get_version()
  27. setup(
  28. name='Django',
  29. version=version,
  30. url='http://www.djangoproject.com/',
  31. author='Django Software Foundation',
  32. author_email='foundation@djangoproject.com',
  33. description=('A high-level Python Web framework that encourages '
  34. 'rapid development and clean, pragmatic design.'),
  35. license='BSD',
  36. packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES),
  37. include_package_data=True,
  38. scripts=['django/bin/django-admin.py'],
  39. entry_points={'console_scripts': [
  40. 'django-admin = django.core.management:execute_from_command_line',
  41. ]},
  42. extras_require={
  43. "bcrypt": ["bcrypt"],
  44. },
  45. zip_safe=False,
  46. classifiers=[
  47. 'Development Status :: 5 - Production/Stable',
  48. 'Environment :: Web Environment',
  49. 'Framework :: Django',
  50. 'Intended Audience :: Developers',
  51. 'License :: OSI Approved :: BSD License',
  52. 'Operating System :: OS Independent',
  53. 'Programming Language :: Python',
  54. 'Programming Language :: Python :: 2',
  55. 'Programming Language :: Python :: 2.7',
  56. 'Programming Language :: Python :: 3',
  57. 'Programming Language :: Python :: 3.4',
  58. 'Programming Language :: Python :: 3.5',
  59. 'Topic :: Internet :: WWW/HTTP',
  60. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  61. 'Topic :: Internet :: WWW/HTTP :: WSGI',
  62. 'Topic :: Software Development :: Libraries :: Application Frameworks',
  63. 'Topic :: Software Development :: Libraries :: Python Modules',
  64. ],
  65. )
  66. if overlay_warning:
  67. sys.stderr.write("""
  68. ========
  69. WARNING!
  70. ========
  71. You have just installed Django over top of an existing
  72. installation, without removing it first. Because of this,
  73. your install may now include extraneous files from a
  74. previous version that have since been removed from
  75. Django. This is known to cause a variety of problems. You
  76. should manually remove the
  77. %(existing_path)s
  78. directory and re-install Django.
  79. """ % {"existing_path": existing_path})