Django

Code

Changeset 3906

Show
Ignore:
Timestamp:
10/16/06 16:50:46 (2 years ago)
Author:
adrian
Message:

Changed setup.py to use standard distutils instead of setuptools. This means installing Django no longer requires a easy_install, setuptools or a working Internet connection, greatly simplifying things.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/setup.py

    r3817 r3906  
    1 import ez_setup # From http://peak.telecommunity.com/DevCenter/setuptools 
    2 ez_setup.use_setuptools() 
     1from distutils.core import setup 
     2from distutils.command.install import INSTALL_SCHEMES 
     3import os 
    34 
    4 from setuptools import setup, find_packages 
     5# Tell distutils to put the data_files in platform-specific installation 
     6# locations. See here for an explanation: 
     7# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb 
     8for scheme in INSTALL_SCHEMES.values(): 
     9    scheme['data'] = scheme['purelib'] 
     10 
     11# Compile the list of packages available, because distutils doesn't have 
     12# an easy way to do this. 
     13packages, data_files = [], [] 
     14root_dir = os.path.join(os.path.dirname(__file__), 'django') 
     15for dirpath, dirnames, filenames in os.walk(root_dir): 
     16    # Ignore dirnames that start with '.' 
     17    for i, dirname in enumerate(dirnames): 
     18        if dirname.startswith('.'): del dirnames[i] 
     19    if '__init__.py' in filenames: 
     20        packages.append(dirpath.replace('/', '.')) 
     21    else: 
     22        data_files.append((dirpath, [os.path.join(dirpath, f) for f in filenames])) 
    523 
    624setup( 
     
    1129    author_email = 'holovaty@gmail.com', 
    1230    description = 'A high-level Python Web framework that encourages rapid development and clean, pragmatic design.', 
    13     license = 'BSD', 
    14     packages = find_packages(exclude=['examples', 'examples.*']), 
    15     package_data = { 
    16         '': ['*.TXT'], 
    17         'django.conf': ['locale/*/LC_MESSAGES/*'], 
    18         'django.contrib.admin': ['templates/admin/*.html', 
    19                                  'templates/admin/auth/user/*.html', 
    20                                  'templates/admin_doc/*.html', 
    21                                  'templates/registration/*.html', 
    22                                  'templates/widget/*.html', 
    23                                  'media/css/*.css', 
    24                                  'media/img/admin/*.gif', 
    25                                  'media/img/admin/*.png', 
    26                                  'media/js/*.js', 
    27                                  'media/js/admin/*js'], 
    28         'django.contrib.comments': ['templates/comments/*.html'], 
    29         'django.contrib.sitemaps': ['templates/*.xml'], 
    30     }, 
     31    packages = packages, 
     32    data_files = data_files, 
    3133    scripts = ['django/bin/django-admin.py'], 
    32     zip_safe = False, 
    3334)