[Distutils] buildout in offline mode - install receipts also from cache?
pombredanne at nexb.com
Mon Jan 21 14:36:50 CET 2013
On Sun, Jan 13, 2013 at 3:49 PM, Jim Fulton <jim at zope.com> wrote:
> On Sat, Jan 12, 2013 at 7:11 PM, Philippe Ombredanne
> <pombredanne at nexb.com> wrote:
>> IMHO it is not possible today to bootstrap and buildout offline. Anyone with
>> a better story there?
> install-from-cache = true
> without specifying offline mode.
> install-from-cache was intended to support exactly this use case.
My bad, and I can now get something to work with for instance:
python bootstrap.py --version 1.7.0 \
--distribute --setup-source=./thirdparty/dist/distribute_setup.py \
and a [buildout] with:
include-site-packages = false
install-from-cache = true
newest = false
allow-picked-versions = false
# we need this in buidlout 1 too
zc.buildout-version = 1.7.0
distribute-version = 0.6.34
# Weirdly enough buildout demands the files to be cached in a dist subdir
# See https://github.com/buildout/buildout/issues/40
download-cache = thirdparty
> Again, I think this works by setting install-from-cache to true.
> The original semantics of offline mode didn't fit it's name. It originally
> meant "don't install anything". That's how it was implemented. The original
> goal was both not to download anything and not to **install** anything.
> Note that this was added before there was a cache.
My naive understanding of offline is "without a network connection"
> Later, offline mode was extended to avoid network access. In particular
> offline mode was changed to disallow extending remote configuration
> files. This change, not made by me, broke some of my companies buildouts.
> I didn't argue with it at the time as the change was consistent with the
> option name, if not the original intent.
> Offline mode is largely a relic of buildout's early evolution. I almost
> never use it and, when I do, I use it in a way that depend on it's
> current semantics. In particular, I use buildout to create configurations
> for installed software. In this context, buildout is running as root and it
> is not OK to install new software.
If anything the option name is as you said incorrect, and the "do not install"
use case somewhat arcane and undocumented. But that is another story.
> I believe that install-from-cache (without offline mode) would address
> Philippe's use case. (It's used by zc.sourcerelease.)
> That leaves the ambiguous meaning of offline mode. In particular,
> buildout 2 potentially provides an opportunity to fix things in a backward-
> incompatible way.
> OTOH, I'd like to avoid any major changes in 2.0 at this point
> because it really needs to get finished as soon as possible.
> Among the options I see at the present:
> - Do nothing. And just document the somewhat weird semantics
> of the name.
Leaving this ambiguity in offline longer would be unfortunate IMHO
> - Add a new option: install, such that install=false has the same
> meaning as offline=true.
> Deprecate the offline option and accompanying command-line option.
That would be the preferred approach IMHO
Do you want a patch?
Though I am not sure how to proceed to deprecate the option....
+1 650 799 0949 | pombredanne at nexB.com
DejaCode Enterprise at http://www.dejacode.com
nexB Inc. at http://www.nexb.com
More information about the Distutils-SIG