Stop using deprecated setuptools.easy_install
Previously, slapos.rebootstrap switched from Python X.X to Python Y.Y by first arranging to have source distributions for zc.buildout and its dependencies, either already available in dowload cache, or downloading them with Python X.X using internal APIs of zc.buildout, then launching Python Y.Y to extract and bootstrap the installation of setuptools, and then use setuptools.easy_install to install the other distributions, meaning zc.buildout and any other dependency. The versions of zc.buildout and its dependencies thus installed are exactly the same as the one originally running with Python X.X. This implies of course that these versions are compatible with Python X.X and Python Y.Y - that is a hard constraint currently. Thus instead of reinstalling them, we can actually just reuse the already installed versions with Python Y.Y by passing the packages in sys.path, giving us a working zc.buildout which we can use to properly reinstall zc.buildout and its dependencies for Python Y.Y. This allows for a much easier process, as we can merely achieve this by calling buildout bootstrap with Python Y.Y without resorting to using internal APIs of zc.buildout to download the source distributions by hand, nor needing to manually bootstrap their installation by extracting setuptools etc. Note that the previous implementation also didn't respect :whl version pins.
Showing
Please register or sign in to comment