No offline capability for bootstrap.py
Bug #542747 reported by
Saint Germain
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Buildout |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The current bootstrap.py is trying to connect to the internet to retrieve the distribute_setup.py or ez_setup, as well as zc.buildout.
For corporate use and reproductibility, it would be better to have an offline mode by giving the path location to retrieve necessary files.
The attached file do just that.
Maybe it's clumsy coding, so I'm open to feedbacks !
Changed in zc.buildout: | |
status: | New → Confirmed |
To post a comment you must log in.
Buildout 1.5.x released a newer version of bootstrap.py, which can keep the script to go over the network:
$ python bootstrap.py --help
Usage: [DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
...
Note that by using --setup-source and --download-base to point to
local resources, you can keep this script from going over the network.
Options: -setup- source= SETUP_SOURCE
Specify a URL or file location for the setup file. If
you use Setuptools, this will default to
http:// peak.telecommun ity.com/ dist/ez_ setup.py; if you
use Distribute, this will default to http:// python-
distribute. org/distribute_ setup.py. -download- base=DOWNLOAD_ BASE
Specify a URL or directory for downloading zc.buildout
and either Setuptools or Distribute. Defaults to PyPI.
...
-
-
...
I have a script which contains the following:
python bootstrap.py \
--setup- source ~/.buildout/ distribute_ setup.py
--download- base ~/.buildout/ downloads/ dist
~/.buildout/ distribute_ setup.py is the official file from Distribute and:
$ ls -1 ~/.buildout/ downloads/ dist/distribute * jon/.buildout/ downloads/ dist/distribute -0.6.14. tar.gz downloads/ dist/zc. buildout* jon/.buildout/ downloads/ dist/zc. buildout- 1.5.2.tar. gz
/home/
$ ls -1 ~/.buildout/
/home/
However, running the "offline" script gives me this (while being offline):
$ ~/Scripts/ bootstrap- offline /home/jon/ .buildout/ downloads/ dist/distribute -0.6.14. tar.gz distribute- 0.6.14 tmpW7Ksxw/ distribute- 0.6.14- py2.6.egg pypi.python. org/simple/ zc.buildout/ ': [Errno -2] Name or service not known -- Some packages may not be found! pypi.python. org/simple/ zc.buildout/ ': [Errno -2] Name or service not known -- Some packages may not be found! pypi.python. org/simple/ ': [Errno -2] Name or service not known -- Some packages may not be found!
Downloading file://
Extracting in /tmp/tmpV762wE
Now working in /tmp/tmpV762wE/
Building a Distribute egg in /tmp/tmpW7Ksxw
/tmp/
Download error for 'http://
Download error for 'http://
Download error for 'http://
install_dir /tmp/tmpW7Ksxw
(I patched Distribute to display the URL in case of Download errors).
It works anyway despite the "Download error" message. However, if my network connection goes online, the bootstrap script spends 3 more seconds to run (it doubles the time actually, I have a 64k connection).
It seems this is due to the creation of the "index" object in the bootstrap.py script:
index = setuptools. package_ index.PackageIn dex(
search_ path=[setup_ requirement_ path])
index. add_find_ links(( find_links, )) Requirement. parse(requireme nt)
if find_links:
req = pkg_resources.
>>> if index.obtain(req) is not None:
Here, "find_links" is the address I gave through the "--download-base" option, but the index is queried anyway. So, if the network is online, it queries Pypi and download something from it (I guess?), otherwise it displays the error and use the find_links address, and so, bot...