No offline capability for

Bug #542747 reported by Saint Germain
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

The current is trying to connect to the internet to retrieve the 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 !

Revision history for this message
Saint Germain (saintger) wrote :
Revision history for this message
Jonathan Ballet (multani) wrote :
Download full text (3.3 KiB)

Buildout 1.5.x released a newer version of, which can keep the script to go over the network:

    $ python --help
    Usage: [DESIRED PYTHON FOR BUILDOUT] [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.

                            Specify a URL or file location for the setup file. If
                            you use Setuptools, this will default to
                  ; if you
                            use Distribute, this will default to http://python-
                            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 \
        --setup-source ~/.buildout/
        --download-base ~/.buildout/downloads/dist

~/.buildout/ is the official file from Distribute and:

  $ ls -1 ~/.buildout/downloads/dist/distribute*
  $ ls -1 ~/.buildout/downloads/dist/zc.buildout*

However, running the "offline" script gives me this (while being offline):

  $ ~/Scripts/bootstrap-offline
  Downloading file:///home/jon/.buildout/downloads/dist/distribute-0.6.14.tar.gz
  Extracting in /tmp/tmpV762wE
  Now working in /tmp/tmpV762wE/distribute-0.6.14
  Building a Distribute egg in /tmp/tmpW7Ksxw
  Download error for '': [Errno -2] Name or service not known -- Some packages may not be found!
  Download error for '': [Errno -2] Name or service not known -- Some packages may not be found!
  Download error for '': [Errno -2] Name or service not known -- Some packages may not be found!
  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 script:

       index = setuptools.package_index.PackageIndex(
       if find_links:
       req = pkg_resources.Requirement.parse(requirement)
>>> 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...


tags: added: offline
Stuart Bishop (stub)
Changed in zc.buildout:
status: New → Confirmed
Revision history for this message
Domen Kožar (ielectric+) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers