[MERGE] Fix installation of bzrlib.benchmarks

John Arbash Meinel john at arbash-meinel.com
Thu Jun 22 17:41:07 BST 2006


Aaron Bentley wrote:
> Martin Pool wrote:
>>> On 21 Jun 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
>>>> Jelmer Vernooij wrote:
>>>>> Hi,
>>>>>
>>>>> The attached bundle fixes the installation of bzrlib.benchmarks.
>>>> +1 and merged.  But this has happened often enough that I think we
>>>> should be testing it.
>>> I had a look at this.  It's actually a little hard to test because you
>>> won't see the problem until you actually try to run the benchmarks in
>>> the installed copy.
> 
> What I had in mind was checking checking whether the source files
> matched the installed files.  e.g. scanning bzrlib, seeing that
> benchmarks/__init__.py should be installed, maybe running a script that
> just imported every module that is visible in the source tree.
> 
>>> (More accurately, it's trivial to check that this
>>> specific bug is fixed but harder to check that we have installed
>>> everything the right way.)
>>>
>>> Really it would be better to fix the Don'tRepeatYourself problem of
>>> listing all the modules there - we should just get distutils to install
>>> everything under that directory.  I think we can do that; I'll have a
>>> look in a bit.
> 
> Sure; at worst, we can do os.listdir in setup.py, to scan for packages
> and modules.

I think that would be the best. Especially since we keep creating new
directories.

I'm surprised setup.py isn't better about checking what gets imported.
I know I've used py2exe before, and it does lots of static checking
(even to the point of checking the dynamic libraries, and seeing what
libraries load what other libraries).
I thought they were just leveraging something in distutils, but I guess not.

> 
>>> In the meantime this patch fixes something else that was annoying me:
>>> the test for setup.py fails if you run it from a different working
>>> directory.
> 
> That's a good goal.
> 
> +0 on the patch.  I like the idea, but sys.argv[0] isn't the right way
> to get the path-- it just provides the text the user typed, without
> following symlinks or being aware of $PATH.  Here's a tweak that uses
> the bzrlib file path to find setup.py.
> 
> Aaron

This is already in setup.py, right? Why can't we just use '__file__'? Or
is it because it is the main script (which has different definitions
than when things are imported).

I would say bzrlib.__file__ is the better way to go, but are we
guaranteed that setup.py is next to bzrlib. If so, then go with
bzrlib.__file__

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060622/d02d7e91/attachment.pgp 


More information about the bazaar mailing list