proposal - move bzrlib down a level

Martin Pool martinpool at gmail.com
Thu Sep 15 01:16:19 BST 2005


On 01/09/05, Robert Collins <robertc at robertcollins.net> wrote:
> I'd like to propose we move bzrlib from /bzrlib to /lib/bzrlib
> 
> The reason for this is simple - it stops us cluttering up the python
> import path. At the moment to import bzrlib, other programs set their
> python path as PYTHONPATH=....:path-to-bzr-root. This means that
> everything we have in the bzr-root is noise that can shadow or otherwise
> interfere. It makes it harder for us to have useful non-installed python
> scripts in our root dir (because they then shadow legitimate python
> packages).

As I understand it, Python doesn't care about files in directories on
the path that don't look like python files, or shared libraries.

At the moment we have only 

  testsweet.py
  setup.py
  bzr-man.py

at the top level.  

testsweet should probably be folded into bzrlib.selftest since it's
rather coupled.  bzr-man.py could be in tools.  The only remaining
problem then is setup.py, which does rather need to be at the top
level; but then it seems kind of unlikely any other code will do
'import setup' just because they're unlikely to find the right one.

> Putting bzrlib in a lib subdirectory wont make it harder for folk using
> bzr - it will make it easier. (they have to set their PYTHONPATH
> regardless).

At the moment if they have a symlink to the copy of ./bzr in the
source tree or the tree on their path and they run that from somewhere
else it will find the right libraries.  If we move the libraries we'd
need to fiddle with the path.

-- 
Martin




More information about the bazaar mailing list