Skip to content
Newer
Older
100644 134 lines (111 sloc) 4.44 KB
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored Oct 16, 2006
1 import os
911f0cd @adrianholovaty Fixed #3203 -- Fixed setup.py bdist_wininst. Thanks for the patch, ym…
adrianholovaty authored Dec 30, 2006
2 import sys
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored Jul 15, 2005
3
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
4 from distutils.core import setup
5 from distutils.sysconfig import get_python_lib
6
6ed7d40 @carljm Fixed #18115 - added warning about overlaid install.
carljm authored May 21, 2012
7 # Warn if we are installing over top of an existing installation. This can
8 # cause issues where files that were deleted from a more recent Django are
9 # still present in site-packages. See #18115.
10 overlay_warning = False
11 if "install" in sys.argv:
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 for lib_path in get_python_lib(), get_python_lib(prefix="/usr/local"):
15 existing_path = os.path.abspath(os.path.join(lib_path, "django"))
16 if os.path.exists(existing_path):
17 # We note the need for the warning here, but present it after the
18 # command is run, so it's more likely to be seen.
19 overlay_warning = True
20 break
21
f284745 @jacobian Fixed #7414: fixed setup.py on OSX 10.5. Thanks, ajs.
jacobian authored Jul 21, 2008
22
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored Apr 3, 2007
23 def fullsplit(path, result=None):
24 """
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
25 Split a pathname into components (the opposite of os.path.join)
26 in a platform-neutral way.
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored Apr 3, 2007
27 """
28 if result is None:
29 result = []
30 head, tail = os.path.split(path)
31 if head == '':
32 return [tail] + result
33 if head == path:
34 return result
35 return fullsplit(head, [tail] + result)
36
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
37
38 EXCLUDE_FROM_PACKAGES = ['django.conf.project_template',
39 'django.conf.app_template',
40 'django.bin']
41
42
43 def is_package(package_name):
44 for pkg in EXCLUDE_FROM_PACKAGES:
45 if package_name.startswith(pkg):
46 return False
47 return True
48
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored Oct 16, 2006
49
50 # Compile the list of packages available, because distutils doesn't have
51 # an easy way to do this.
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
52 packages, package_data = [], {}
53
a08ed9d @adrianholovaty Fixed #2989 -- easy_install now works with Django's setup.py. Thanks …
adrianholovaty authored Nov 27, 2006
54 root_dir = os.path.dirname(__file__)
dd2afd7 @malcolmt Changed setup.py to work no matter where it is called from. We were p…
malcolmt authored Feb 21, 2008
55 if root_dir != '':
56 os.chdir(root_dir)
57 django_dir = 'django'
a08ed9d @adrianholovaty Fixed #2989 -- easy_install now works with Django's setup.py. Thanks …
adrianholovaty authored Nov 27, 2006
58
59 for dirpath, dirnames, filenames in os.walk(django_dir):
2100da9 @ramiro Ensure we ignore __pycache__ PEP 3174 dirs in a few more places.
ramiro authored Oct 6, 2012
60 # Ignore PEP 3147 cache dirs and those whose names start with '.'
1c086df @ramiro [1.5.x] Fix filtering during collection of paths in setup.py
ramiro authored Feb 14, 2013
61 dirnames[:] = [d for d in dirnames if not d.startswith('.') and d != '__pycache__']
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
62 parts = fullsplit(dirpath)
63 package_name = '.'.join(parts)
64 if '__init__.py' in filenames and is_package(package_name):
65 packages.append(package_name)
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored Apr 3, 2007
66 elif filenames:
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
67 relative_path = []
68 while '.'.join(parts) not in packages:
69 relative_path.append(parts.pop())
70 relative_path.reverse()
71 path = os.path.join(*relative_path)
72 package_files = package_data.setdefault('.'.join(parts), [])
73 package_files.extend([os.path.join(path, f) for f in filenames])
911f0cd @adrianholovaty Fixed #3203 -- Fixed setup.py bdist_wininst. Thanks for the patch, ym…
adrianholovaty authored Dec 30, 2006
74
e73bf2b @malcolmt Fixed #3203 (again!) -- Install data files in the right place on MS W…
malcolmt authored Aug 12, 2008
75
49f6d06 @adrianholovaty Fixed #3117 -- Changed setup.py to get version from django.VERSION dy…
adrianholovaty authored Dec 13, 2006
76 # Dynamically calculate the version based on django.VERSION.
40f0ecc @aaugustin Implemented PEP386-compatible version numbers. Thanks Jannis for the …
aaugustin authored Jan 8, 2012
77 version = __import__('django').get_version()
49f6d06 @adrianholovaty Fixed #3117 -- Changed setup.py to get version from django.VERSION dy…
adrianholovaty authored Dec 13, 2006
78
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
79
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored Jul 15, 2005
80 setup(
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
81 name='Django',
82 version=version,
83 url='http://www.djangoproject.com/',
84 author='Django Software Foundation',
85 author_email='foundation@djangoproject.com',
86 description=('A high-level Python Web framework that encourages '
87 'rapid development and clean, pragmatic design.'),
1d5dfd0 @timgraham [1.5.x] Bumped version for 1.5.12 release.
timgraham authored Jan 2, 2015
88 download_url='https://www.djangoproject.com/m/releases/1.5/Django-1.5.12.tar.gz',
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
89 license='BSD',
90 packages=packages,
91 package_data=package_data,
92 scripts=['django/bin/django-admin.py'],
93 classifiers=[
5209382 @ubernostrum [1.5.x] Update trove classifier for 1.5 final release.
ubernostrum authored Feb 26, 2013
94 'Development Status :: 5 - Production/Stable',
3d5a8f7 @adrianholovaty Changed setup.py classifiers to use a better indentation style
adrianholovaty authored Mar 28, 2011
95 'Environment :: Web Environment',
96 'Framework :: Django',
97 'Intended Audience :: Developers',
98 'License :: OSI Approved :: BSD License',
99 'Operating System :: OS Independent',
100 'Programming Language :: Python',
9d86550 @aaugustin [1.5.x] Fixed #20615 -- Added trove classifiers for major Python vers…
aaugustin authored Jun 18, 2013
101 'Programming Language :: Python :: 2',
3d5a8f7 @adrianholovaty Changed setup.py classifiers to use a better indentation style
adrianholovaty authored Mar 28, 2011
102 'Programming Language :: Python :: 2.6',
103 'Programming Language :: Python :: 2.7',
9d86550 @aaugustin [1.5.x] Fixed #20615 -- Added trove classifiers for major Python vers…
aaugustin authored Jun 18, 2013
104 'Programming Language :: Python :: 3',
ed96292 @ubernostrum [1.5.x] Bump version information and classifiers for 1.5 alpha release.
ubernostrum authored Oct 25, 2012
105 'Programming Language :: Python :: 3.2',
106 'Programming Language :: Python :: 3.3',
3d5a8f7 @adrianholovaty Changed setup.py classifiers to use a better indentation style
adrianholovaty authored Mar 28, 2011
107 'Topic :: Internet :: WWW/HTTP',
108 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
109 'Topic :: Internet :: WWW/HTTP :: WSGI',
110 'Topic :: Software Development :: Libraries :: Application Frameworks',
111 'Topic :: Software Development :: Libraries :: Python Modules',
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
112 ],
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored Jul 15, 2005
113 )
6ed7d40 @carljm Fixed #18115 - added warning about overlaid install.
carljm authored May 21, 2012
114
115 if overlay_warning:
116 sys.stderr.write("""
117
118 ========
119 WARNING!
120 ========
121
122 You have just installed Django over top of an existing
123 installation, without removing it first. Because of this,
124 your install may now include extraneous files from a
125 previous version that have since been removed from
126 Django. This is known to cause a variety of problems. You
127 should manually remove the
128
129 %(existing_path)s
130
131 directory and re-install Django.
132
4391718 @apollo13 [1.5.x] Fixed #19252 -- Added support for wheel packages.
apollo13 authored Apr 3, 2013
133 """ % {"existing_path": existing_path})
Something went wrong with that request. Please try again.