proposal - move bzrlib down a level
Robert Collins
robertc at robertcollins.net
Wed Sep 14 20:19:43 BST 2005
On Sun, 2005-09-04 at 20:32 -0400, Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert Collins wrote:
> > On Thu, 2005-09-01 at 09:49 -0400, Aaron Bentley wrote:
>
> >>So if you actually install bzrlib, you don't have to muck with your
> >>PYTHONPATH, and there's no garbage. (btw, is there *any* satisfactory
> >>way to muck with one's PYTHONPATH? I don't want to stick the whole
> >>thing in my profile because I run more than one interpreter, and the
> >>system libs vary.)
> >
> >
> > install it where ?
>
> I would suggest in the home directory of the user pqm runs as.
>
> python2.4 setup.py install --prefix ~
That just messes it up for any other software that is present. One of
pythons beautiful things is working -really well- when its not
installed. But not conflicting spuriously on at the top level is its one
main weakness.
> > Take for instance the pqm install @ pqm.ubuntu.com.
> > I'm not the sysadmin, so I can't install bzrlib to the python
> > site-packages easily. If I install it to the source tree I'm working on
> > I get lovely noise that cant be updated without an rm -rf and a
> > re-install. Even if I do get our sysadmin to install it, I'm then stuck
> > with continual fiddling if we want to roll forward, or backwards. This
> > is a pretty typical scenario for stuff installed
> > not-on-ones-own-machine.
>
> Yes, but I believe it's also a solved problem. Isn't 'install with
> prefix' the way it's typically handled?
Installing with a prefix means that I need to keep reinstalling whenever
I tweak something: its a step that I kept forgetting, and what got me
swearing off -ever- installing python software, except as a binary
package.
> Or you can just stick a symlink to bzrlib in the directory where pqm lives.
>
> Alternatively, you can just stick a symlink to bzrlib in an otherwise
> empty directory, and stick that in your PYTHONPATH.
Thats exactly what I'm proposing - except that we should ship that empty
directory for people.
> > As for changes needed to bzr to deal with a lib dir rather than bzrlib
> > at the top dir of the source:
> >
> > try:
> > import bzrlib
> > except ImportError:
> > sys.path.append(os.path.join(sys.argv[0],'..', 'lib'))
> > import bzrlib
>
> That looks icky to me.
what about:
==
sys.path.append(os.path.join(sys.argv[0],'..', 'lib'))
import bzrlib
==
which will also work, and will always favour the lib/ dir under the bzr
files location over random local paths.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050915/225b309f/attachment.pgp
More information about the bazaar
mailing list