setup.py 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import os
  2. import sys
  3. from setuptools import setup, find_packages
  4. from distutils.sysconfig import get_python_lib
  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 :: 3 - Alpha',
  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.2',
  58. 'Programming Language :: Python :: 3.3',
  59. 'Programming Language :: Python :: 3.4',
  60. 'Topic :: Internet :: WWW/HTTP',
  61. 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
  62. 'Topic :: Internet :: WWW/HTTP :: WSGI',
  63. 'Topic :: Software Development :: Libraries :: Application Frameworks',
  64. 'Topic :: Software Development :: Libraries :: Python Modules',
  65. ],
  66. )
  67. if overlay_warning:
  68. sys.stderr.write("""
  69. ========
  70. WARNING!
  71. ========
  72. You have just installed Django over top of an existing
  73. installation, without removing it first. Because of this,
  74. your install may now include extraneous files from a
  75. previous version that have since been removed from
  76. Django. This is known to cause a variety of problems. You
  77. should manually remove the
  78. %(existing_path)s
  79. directory and re-install Django.
  80. """ % {"existing_path": existing_path})