Skip to content
Newer
Older
100644 64 lines (57 sloc) 2.09 KB
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored
1 from distutils.core import setup
2 from distutils.command.install import INSTALL_SCHEMES
3 import os
911f0cd @adrianholovaty Fixed #3203 -- Fixed setup.py bdist_wininst. Thanks for the patch, ym…
adrianholovaty authored
4 import sys
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored
5
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored
6 def fullsplit(path, result=None):
7 """
8 Split a pathname into components (the opposite of os.path.join) in a
9 platform-neutral way.
10 """
11 if result is None:
12 result = []
13 head, tail = os.path.split(path)
14 if head == '':
15 return [tail] + result
16 if head == path:
17 return result
18 return fullsplit(head, [tail] + result)
19
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored
20 # Tell distutils to put the data_files in platform-specific installation
21 # locations. See here for an explanation:
22 # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
23 for scheme in INSTALL_SCHEMES.values():
24 scheme['data'] = scheme['purelib']
25
26 # Compile the list of packages available, because distutils doesn't have
27 # an easy way to do this.
28 packages, data_files = [], []
a08ed9d @adrianholovaty Fixed #2989 -- easy_install now works with Django's setup.py. Thanks …
adrianholovaty authored
29 root_dir = os.path.dirname(__file__)
30 django_dir = os.path.join(root_dir, 'django')
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored
31 pieces = fullsplit(root_dir)
32 if pieces[-1] == '':
f791a59 @adrianholovaty Negligible formatting changes to some recent commits
adrianholovaty authored
33 len_root_dir = len(pieces) - 1
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored
34 else:
35 len_root_dir = len(pieces)
a08ed9d @adrianholovaty Fixed #2989 -- easy_install now works with Django's setup.py. Thanks …
adrianholovaty authored
36
37 for dirpath, dirnames, filenames in os.walk(django_dir):
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored
38 # Ignore dirnames that start with '.'
39 for i, dirname in enumerate(dirnames):
40 if dirname.startswith('.'): del dirnames[i]
41 if '__init__.py' in filenames:
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored
42 packages.append('.'.join(fullsplit(dirpath)[len_root_dir:]))
43 elif filenames:
911f0cd @adrianholovaty Fixed #3203 -- Fixed setup.py bdist_wininst. Thanks for the patch, ym…
adrianholovaty authored
44 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
45
49f6d06 @adrianholovaty Fixed #3117 -- Changed setup.py to get version from django.VERSION dy…
adrianholovaty authored
46 # Dynamically calculate the version based on django.VERSION.
b9d077c @malcolmt Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problem…
malcolmt authored
47 version_tuple = __import__('django').VERSION
48 if version_tuple[2] is not None:
49 version = "%d.%d_%s" % version_tuple
50 else:
51 version = "%d.%d" % version_tuple[:2]
49f6d06 @adrianholovaty Fixed #3117 -- Changed setup.py to get version from django.VERSION dy…
adrianholovaty authored
52
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored
53 setup(
b2424a3 @adrianholovaty Updated setup.py to include locales and *.TXT in package_data. Change…
adrianholovaty authored
54 name = "Django",
49f6d06 @adrianholovaty Fixed #3117 -- Changed setup.py to get version from django.VERSION dy…
adrianholovaty authored
55 version = version,
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored
56 url = 'http://www.djangoproject.com/',
41c99f3 @adrianholovaty Changed setup.py author and added django-admin to distutils 'scripts'
adrianholovaty authored
57 author = 'Lawrence Journal-World',
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored
58 author_email = 'holovaty@gmail.com',
59 description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.',
1d42481 @adrianholovaty Changed setup.py to use standard distutils instead of setuptools. Thi…
adrianholovaty authored
60 packages = packages,
61 data_files = data_files,
41c99f3 @adrianholovaty Changed setup.py author and added django-admin to distutils 'scripts'
adrianholovaty authored
62 scripts = ['django/bin/django-admin.py'],
775f433 @adrianholovaty Moved django.bin.setup to root level and converted it to use setuptoo…
adrianholovaty authored
63 )
Something went wrong with that request. Please try again.