Changeset 12455 for main/waeup.ikoba/trunk
- Timestamp:
- 12 Jan 2015, 21:11:03 (10 years ago)
- Location:
- main/waeup.ikoba/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/CHANGES.txt
r12408 r12455 4 4 0.2dev (unreleased) 5 5 =================== 6 7 * Update bootstrap.py and dependent package versions. 6 8 7 9 * Add products, documents and customers modules and tons of components. -
main/waeup.ikoba/trunk/bootstrap.py
r11851 r12455 36 36 Python that you want bin/buildout to use. 37 37 38 Note that by using --find-links to point to local resources, you can keep 38 Note that by using --find-links to point to local resources, you can keep 39 39 this script from going over the network. 40 40 ''' … … 57 57 parser.add_option("-f", "--find-links", 58 58 help=("Specify a URL to search for buildout releases")) 59 parser.add_option("--allow-site-packages", 60 action="store_true", default=False, 61 help=("Let bootstrap.py use existing site packages")) 62 parser.add_option("--setuptools-version", 63 help="use a specific setuptools version") 59 64 60 65 … … 62 67 63 68 ###################################################################### 64 # load/install distribute69 # load/install setuptools 65 70 66 to_reload = False67 71 try: 68 import pkg_resources 69 import setuptools 70 if not hasattr(pkg_resources, '_distribute'): 71 to_reload = True 72 raise ImportError 72 if options.allow_site_packages: 73 import setuptools 74 import pkg_resources 75 from urllib.request import urlopen 73 76 except ImportError: 74 ez = {}77 from urllib2 import urlopen 75 78 76 try: 77 from urllib.request import urlopen 78 except ImportError: 79 from urllib2 import urlopen 79 ez = {} 80 exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez) 80 81 81 exec(urlopen( 82 'http://downloads.buildout.org/2.1/distribute_setup.py').read(), ez) 83 setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True) 84 ez['use_setuptools'](**setup_args) 82 if not options.allow_site_packages: 83 # ez_setup imports site, which adds site packages 84 # this will remove them from the path to ensure that incompatible versions 85 # of setuptools are not in the path 86 import site 87 # inside a virtualenv, there is no 'getsitepackages'. 88 # We can't remove these reliably 89 if hasattr(site, 'getsitepackages'): 90 for sitepackage_path in site.getsitepackages(): 91 sys.path[:] = [x for x in sys.path if sitepackage_path not in x] 85 92 86 if to_reload: 87 reload(pkg_resources) 88 import pkg_resources 89 # This does not (always?) update the default working set. We will 90 # do it. 91 for path in sys.path: 92 if path not in pkg_resources.working_set.entries: 93 pkg_resources.working_set.add_entry(path) 93 setup_args = dict(to_dir=tmpeggs, download_delay=0) 94 95 if options.setuptools_version is not None: 96 setup_args['version'] = options.setuptools_version 97 98 ez['use_setuptools'](**setup_args) 99 import setuptools 100 import pkg_resources 101 102 # This does not (always?) update the default working set. We will 103 # do it. 104 for path in sys.path: 105 if path not in pkg_resources.working_set.entries: 106 pkg_resources.working_set.add_entry(path) 94 107 95 108 ###################################################################### … … 111 124 cmd.extend(['-f', find_links]) 112 125 113 distribute_path = ws.find(114 pkg_resources.Requirement.parse(' distribute')).location126 setuptools_path = ws.find( 127 pkg_resources.Requirement.parse('setuptools')).location 115 128 116 129 requirement = 'zc.buildout' … … 122 135 123 136 def _final_version(parsed_version): 124 for part in parsed_version: 125 if (part[:1] == '*') and (part not in _final_parts): 126 return False 127 return True 137 try: 138 return not parsed_version.is_prerelease 139 except AttributeError: 140 # Older setuptools 141 for part in parsed_version: 142 if (part[:1] == '*') and (part not in _final_parts): 143 return False 144 return True 145 128 146 index = setuptools.package_index.PackageIndex( 129 search_path=[ distribute_path])147 search_path=[setuptools_path]) 130 148 if find_links: 131 149 index.add_find_links((find_links,)) … … 150 168 151 169 import subprocess 152 if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH= distribute_path)) != 0:170 if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0: 153 171 raise Exception( 154 "Failed to execute command:\n%s", 155 repr(cmd)[1:-1]) 172 "Failed to execute command:\n%s" % repr(cmd)[1:-1]) 156 173 157 174 ###################################################################### -
main/waeup.ikoba/trunk/versions.cfg
r12182 r12455 19 19 transaction = 1.1.0 20 20 z3c.testsetup = 0.6.1 21 zc.buildout = 2. 1.021 zc.buildout = 2.2.5 22 22 zc.recipe.egg = 2.0.0a3 23 23 zc.recipe.testrunner = 2.0.0
Note: See TracChangeset for help on using the changeset viewer.