Ticket #316: setup.py.patch
-
setup.py
old new 8 8 9 9 from distutils.core import setup 10 10 from distutils.command.install import INSTALL_SCHEMES 11 import sys 11 import sys 12 import os 12 13 13 14 required_python_version = '2.3' 14 15 … … 53 54 ############################################################################### 54 55 # end arguments for setup 55 56 ############################################################################### 56 57 58 57 59 def main(): 58 60 if sys.version < required_python_version: 59 61 s = "I'm sorry, but %s %s requires Python %s or later." 60 62 print s % (name, version, required_python_version) 61 sys.exit(1) 62 63 sys.exit(1) 64 63 65 # set default location for "data_files" to platform specific "site-packages" 64 66 # location 65 67 for scheme in INSTALL_SCHEMES.values(): 66 68 scheme['data'] = scheme['purelib'] 67 69 68 setup(70 dist = setup( 69 71 name=name, 70 72 version=version, 71 73 description=desc, … … 78 80 packages=packages, 79 81 download_url=download_url, 80 82 data_files=data_files, 81 ) 83 ) 84 85 # get the installation directory (is there a better way to do this? 86 install_dir = dist.command_obj['install_lib'].install_dir 87 88 # make sure we have an absolute install path 89 install_dir = os.path.join(os.path.abspath('/'), install_dir) 90 91 old_session_filter_path = os.path.join( 92 install_dir, 'cherrypy', 'lib', 'filter', 'sessionfilter') 93 94 # check for existence of old sessionfilter package dir 95 # and warn user if present 96 if os.path.exists(old_session_filter_path): 97 warn_old_session_filter(old_session_filter_path) 98 99 100 def warn_old_session_filter(pth): 101 msg = """ 102 ************************ WARNING ***************************** 103 Since you have installed over the top of an existing CherryPy 104 installation, you must remove the old sessionfilter package 105 directory at: 106 %s 107 ************************ WARNING ***************************** 108 """ % (pth,) 109 print msg 110 82 111 83 112 if __name__ == "__main__": 84 113 main() 85

