git-svn-id: http://code.djangoproject.com/svn/django/trunk@17351 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
aa5d307da6
commit
f46003559c
|
@ -14,3 +14,17 @@ def get_version():
|
||||||
if svn_rev != u'SVN-unknown':
|
if svn_rev != u'SVN-unknown':
|
||||||
version = "%s %s" % (version, svn_rev)
|
version = "%s %s" % (version, svn_rev)
|
||||||
return version
|
return version
|
||||||
|
|
||||||
|
def get_distutils_version():
|
||||||
|
# Distutils expects a version number formatted as major.minor[.patch][sub]
|
||||||
|
parts = 5
|
||||||
|
if VERSION[3] == 'final':
|
||||||
|
parts = 3
|
||||||
|
if VERSION[2] == 0:
|
||||||
|
parts = 2
|
||||||
|
version = VERSION[:parts]
|
||||||
|
version = [str(x)[0] for x in version] # ['1', '4', '0', 'a', '1']
|
||||||
|
if parts > 2:
|
||||||
|
version[2:] = [''.join(version[2:])] # ['1', '4', '0a1']
|
||||||
|
version = '.'.join(version) # '1.4.0a1'
|
||||||
|
return version
|
||||||
|
|
14
setup.py
14
setup.py
|
@ -17,10 +17,10 @@ class osx_install_data(install_data):
|
||||||
self.set_undefined_options('install', ('install_lib', 'install_dir'))
|
self.set_undefined_options('install', ('install_lib', 'install_dir'))
|
||||||
install_data.finalize_options(self)
|
install_data.finalize_options(self)
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
cmdclasses = {'install_data': osx_install_data}
|
cmdclasses = {'install_data': osx_install_data}
|
||||||
else:
|
else:
|
||||||
cmdclasses = {'install_data': install_data}
|
cmdclasses = {'install_data': install_data}
|
||||||
|
|
||||||
def fullsplit(path, result=None):
|
def fullsplit(path, result=None):
|
||||||
"""
|
"""
|
||||||
|
@ -66,13 +66,11 @@ if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':
|
||||||
file_info[0] = '\\PURELIB\\%s' % file_info[0]
|
file_info[0] = '\\PURELIB\\%s' % file_info[0]
|
||||||
|
|
||||||
# Dynamically calculate the version based on django.VERSION.
|
# Dynamically calculate the version based on django.VERSION.
|
||||||
version = __import__('django').get_version()
|
version = __import__('django').get_distutils_version()
|
||||||
if u'SVN' in version:
|
|
||||||
version = ' '.join(version.split(' ')[:-1])
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "Django",
|
name = "Django",
|
||||||
version = version.replace(' ', '-'),
|
version = version,
|
||||||
url = 'http://www.djangoproject.com/',
|
url = 'http://www.djangoproject.com/',
|
||||||
author = 'Django Software Foundation',
|
author = 'Django Software Foundation',
|
||||||
author_email = 'foundation@djangoproject.com',
|
author_email = 'foundation@djangoproject.com',
|
||||||
|
|
Loading…
Reference in New Issue