Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24837

Re: Why site-packages?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!border2.nntp.ams2.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'python,': 0.02; 'startup': 0.05; 'script,': 0.09; 'subject:Why': 0.09; 'cc:addr:python-list': 0.10; 'cc:name:python list': 0.16; 'duplicating': 0.16; 'examples?': 0.16; 'imo.': 0.16; 'reusable': 0.16; 'wrote:': 0.17; 'test.': 0.17; 'code,': 0.18; 'module': 0.19; 'written': 0.20; "i'd": 0.22; 'cc:2**0': 0.23; 'purposes': 0.23; 'third-party': 0.23; 'installed': 0.23; "i've": 0.23; 'seems': 0.23; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'setting': 0.26; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'dan': 0.29; 'fast.': 0.29; 'measure': 0.29; 'stuff': 0.30; 'expect': 0.31; 'code': 0.31; "aren't": 0.33; 'directory,': 0.33; 'that,': 0.34; 'version': 0.34; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'be.': 0.36; 'should': 0.36; 'two': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'things': 0.38; 'there,': 0.38; 'little': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'most': 0.61; "you've": 0.61; 'real': 0.61; 'situation': 0.62; 'different': 0.63; 'more': 0.63; 'jul': 0.65; 'advantages': 0.71; 'grow': 0.74; 'informative,': 0.84; 'irrelevant': 0.84; 'site?': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=7OOPgJ+z1xtlOdt4fuUJekDGg3ODyfl30mZI25ntcQE=; b=wn5mTFSyp5SL7InvS3/zwke6A4YKBk1YKdJvuZMbgcMHu3iePo+xdxGNKsFq9VFhDb fd5xxhVmfZIjIIOXILgv5kN2d7xGq/d9JKC+Kxh/LQQt62tUHazz79uZ7hvFp+J0SpOy J+PXUMOk7W/XtG++a/NI5/J51j1PUEpcpmg3wRtmVnF/oLYuCoa1eZH5nJIx7P6r+RLU erD2YIf8I/tUgn3oOCF/NGgUmS1n9Qbl78YNlj1c9S0U6/X5pHB69HDX2WNdHhGVL9Z/ wRwwikIZKbWryK4SnPPjAFaWPPkMZkpMheF+1LkAnFbCDpU15+LwdImSrZnMGyCvqWmJ t7cg==
MIME-Version 1.0
In-Reply-To <CAGGBd_rK+D8DE0FkGLSpVbbpZc-YommKKtX_ki2wJOacVVe3Zg@mail.gmail.com>
References <CAGGBd_przF6HtPz5EQ=D8PssmQSda79n=ZwkZKoeQDaz4Dpg8w@mail.gmail.com> <CALwzidnvsU=zT0Vi2ckTNA6pwBbHLb-S34HcXpt1QDwX8rJGWQ@mail.gmail.com> <CAGGBd_rK+D8DE0FkGLSpVbbpZc-YommKKtX_ki2wJOacVVe3Zg@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 3 Jul 2012 16:04:45 -0600
Subject Re: Why site-packages?
To Dan Stromberg <drsalists@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc Python List <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1764.1341353116.4697.python-list@python.org> (permalink)
Lines 36
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1341353116 news.xs4all.nl 6985 [2001:888:2000:d::a6]:41308
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:24837

Show key headers only | View raw


On Tue, Jul 3, 2012 at 3:34 PM, Dan Stromberg <drsalists@gmail.com> wrote:
> If it was intended to be reusable code, I'd think it -should- go in
> site-packages.
>
> But so much code in site-packages isn't intended to be reusable.

Can you give some examples?  Looking through my site-packages
directory, everything in there is either used by multiple applications
or at least has the potential to be.  Frankly, if you've installed a
third-party package and written your own code against it, even if only
in one little script, isn't that already reuse?

> And even for stuff that's reusable, there are advantages to just duplicating
> them for the purposes of each application, because you never know when one
> of them is going to need a different version from another.

Definitely a situation for virtualenv, IMO.

>> The site module has to process any .pth files in the site-packages,
>> but apart from that, I think the actual amount of stuff in
>> site-packages should be irrelevant.
>
> Irrelevant to what?   More stuff in site slowing things down?  Are .pth's
> not correlated with more stuff in site-packages?  Aren't they actually a
> thing In site?

Yes, but I just don't expect the .pth files to grow that fast.  I've
got something like 30 packages in my site-packages and only 6 .pth
files, and most of those are one-liners.

Right now this all seems highly speculative to me.  I think it might
be informative, either to you or to me, to do an actual timing test.
Why don't you try setting up two side-by-side installations of Python,
one with all the site-packages cruft, and one trimmed down to only
what you think should be in there, and see if you can measure a real
difference in startup time?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Why site-packages? Ian Kelly <ian.g.kelly@gmail.com> - 2012-07-03 16:04 -0600

csiph-web