Changeset 5734 for django/branches/schema-evolution/setup.py
- Timestamp:
- 07/20/07 15:49:49 (1 year ago)
- Files:
-
- django/branches/schema-evolution/setup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/schema-evolution/setup.py
r3937 r5734 2 2 from distutils.command.install import INSTALL_SCHEMES 3 3 import os 4 import sys 5 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) 4 19 5 20 # Tell distutils to put the data_files in platform-specific installation … … 12 27 # an easy way to do this. 13 28 packages, data_files = [], [] 14 root_dir = os.path.join(os.path.dirname(__file__), 'django') 15 for dirpath, dirnames, filenames in os.walk(root_dir): 29 root_dir = os.path.dirname(__file__) 30 django_dir = os.path.join(root_dir, 'django') 31 pieces = fullsplit(root_dir) 32 if pieces[-1] == '': 33 len_root_dir = len(pieces) - 1 34 else: 35 len_root_dir = len(pieces) 36 37 for dirpath, dirnames, filenames in os.walk(django_dir): 16 38 # Ignore dirnames that start with '.' 17 39 for i, dirname in enumerate(dirnames): 18 40 if dirname.startswith('.'): del dirnames[i] 19 41 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])) 42 packages.append('.'.join(fullsplit(dirpath)[len_root_dir:])) 43 elif filenames: 44 data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]]) 45 46 # Dynamically calculate the version based on django.VERSION. 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] 23 52 24 53 setup( 25 54 name = "Django", 26 version = "0.95",55 version = version, 27 56 url = 'http://www.djangoproject.com/', 28 57 author = 'Lawrence Journal-World',
