12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import os
- import site
- import sys
- from distutils.sysconfig import get_python_lib
- from setuptools import setup
- site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
- overlay_warning = False
- if "install" in sys.argv:
- lib_paths = [get_python_lib()]
- if lib_paths[0].startswith("/usr/lib/"):
-
-
- lib_paths.append(get_python_lib(prefix="/usr/local"))
- for lib_path in lib_paths:
- existing_path = os.path.abspath(os.path.join(lib_path, "django"))
- if os.path.exists(existing_path):
-
-
- overlay_warning = True
- break
- setup()
- if overlay_warning:
- sys.stderr.write(
- """
- ========
- WARNING!
- ========
- You have just installed Django over top of an existing
- installation, without removing it first. Because of this,
- your install may now include extraneous files from a
- previous version that have since been removed from
- Django. This is known to cause a variety of problems. You
- should manually remove the
- %(existing_path)s
- directory and re-install Django.
- """
- % {"existing_path": existing_path}
- )
|