Commit b587be74 authored by Tres Seaver's avatar Tres Seaver

Update to latest bootstrap.

parent 14683935
...@@ -59,6 +59,8 @@ parser.add_option("-f", "--find-links", ...@@ -59,6 +59,8 @@ parser.add_option("-f", "--find-links",
parser.add_option("--allow-site-packages", parser.add_option("--allow-site-packages",
action="store_true", default=False, action="store_true", default=False,
help=("Let bootstrap.py use existing site packages")) help=("Let bootstrap.py use existing site packages"))
parser.add_option("--setuptools-version",
help="use a specific setuptools version")
options, args = parser.parse_args() options, args = parser.parse_args()
...@@ -89,6 +91,10 @@ if not options.allow_site_packages: ...@@ -89,6 +91,10 @@ if not options.allow_site_packages:
sys.path[:] = [x for x in sys.path if sitepackage_path not in x] sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
setup_args = dict(to_dir=tmpeggs, download_delay=0) setup_args = dict(to_dir=tmpeggs, download_delay=0)
if options.setuptools_version is not None:
setup_args['version'] = options.setuptools_version
ez['use_setuptools'](**setup_args) ez['use_setuptools'](**setup_args)
import setuptools import setuptools
import pkg_resources import pkg_resources
...@@ -128,10 +134,15 @@ if version is None and not options.accept_buildout_test_releases: ...@@ -128,10 +134,15 @@ if version is None and not options.accept_buildout_test_releases:
_final_parts = '*final-', '*final' _final_parts = '*final-', '*final'
def _final_version(parsed_version): def _final_version(parsed_version):
try:
return not parsed_version.is_prerelease
except AttributeError:
# Older setuptools
for part in parsed_version: for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts): if (part[:1] == '*') and (part not in _final_parts):
return False return False
return True return True
index = setuptools.package_index.PackageIndex( index = setuptools.package_index.PackageIndex(
search_path=[setuptools_path]) search_path=[setuptools_path])
if find_links: if find_links:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment