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


Groups > comp.lang.python > #78899

Re: virtualenv question: include just a few site packages

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'desired.': 0.07; 'elegant,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:few': 0.09; 'subject:virtualenv': 0.09; 'sure,': 0.09; 'subject:question': 0.10; 'deletes': 0.16; 'experiments': 0.16; 'modules,': 0.16; 'modules.': 0.16; 'pyinstaller': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'script,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; 'packages.': 0.19; 'example': 0.22; 'import': 0.22; 'install': 0.23; 'header:User-Agent:1': 0.23; 'replace': 0.24; "shouldn't": 0.24; 'environment': 0.24; 'options': 0.25; 'switch': 0.26; 'asking': 0.27; 'certain': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'wonder': 0.29; "i'm": 0.30; "skip:' 10": 0.31; 'idea,': 0.31; 'ok.': 0.31; 'option.': 0.31; 'way?': 0.31; 'anyone': 0.31; 'probably': 0.32; 'run': 0.32; '(including': 0.33; '-----': 0.33; 'guess': 0.33; 'received:fr': 0.33; 'moment': 0.34; "i'd": 0.34; 'could': 0.34; 'test': 0.35; 'but': 0.35; 'add': 0.35; 'there': 0.35; 'version': 0.36; 'really': 0.36; 'installing': 0.36; 'should': 0.36; 'virtual': 0.37; 'skip:- 20': 0.37; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'skip:- 10': 0.38; 'pm,': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'remove': 0.60; 'easy': 0.60; 'manually': 0.60; 'more': 0.64; 'charset:windows-1252': 0.65; 'received:109': 0.72; 'hand': 0.80; 'refuse': 0.93; 'vip': 0.96
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Gelonida N <gelonida@gmail.com>
Subject Re: virtualenv question: include just a few site packages
Date Thu, 09 Oct 2014 17:55:44 +0200
References <m14cnh$2hv$1@ger.gmane.org> <515407053.9531235.1412860769774.JavaMail.root@sequans.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 1-75-190-109.dsl.ovh.fr
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2
In-Reply-To <515407053.9531235.1412860769774.JavaMail.root@sequans.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.14719.1412870165.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1412870165 news.xs4all.nl 2913 [2001:888:2000:d::a6]:51477
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:78899

Show key headers only | View raw


On 10/09/2014 03:19 PM, Jean-Michel Pichavant wrote:
> ----- Original Message -----
>> virtualenv has the switch
>> --system-site-packages (including all system site pacgaes)
>> and the switch
>> --no-site-packages (to expclude all site packages)
>>
>> Does anyone know an easy way to include just a few site-packages?
>> for example (PySide, but not PyQt)
>>
>> The reason I'm asking is following.
>> Some site packages  are sometimes raher huge or sometimes refuse to
>> compile on certain hosts.
>>
>> as these packages are already part of the site packages I'd like to
>> include them.
>>
>> You might wonder why I care whether I have more site packages than I
>> need. As long as I don't import them,  I shouldn't care about it.
>> If I really wanted to replace a version I could use pip install -U.
>>
>> However sometimes I'd like to have a test environment where want to
>> be
>> sure, that no module can find certain other modules. so they should
>> not be visible.
>>
>> at the moment I make some experiments with pyinstaller and the module
>> pythonqtbindings. and there I'd like to be sure that no PuQt files
>> end up in the generated code.
>>
>> The only idea, that I have so far is to
>> run virutalanv with --system-side-packages and to manually remove
>> modules I don't want or to
>> run virtualenv without this switch and to manually add links for site
>> packages, taht I want. both options don't really feel right for me.
>>
>> Is there any other way?
>
> You could build a virtual machine, installing only your VIP modules, and create virtual environment on this virtual machine, using the system site packages.
>

Yeah that's an option.

However I guess in this case it's probably faster to write a script, 
that 'post-processes' the virtualenv and just deletes files / symlinks, 
that are not desired. Definitely not elegant, but probably OK. On the 
other hand a VM migfht help finding out which files to keep.



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


Thread

Re: virtualenv question: include just a few site packages Gelonida N <gelonida@gmail.com> - 2014-10-09 17:55 +0200

csiph-web