The "bin" thing is really just historical; it's pretty pointless, I just
don't think anybody has really cared enough to go through the trouble of
eliminating it. You have to be careful, because bin is also where the
executables live so you have to make sure you fix up anything executing
scripts in there, not just all the import statements.

As for the kvm libraries, I think that looks fine, not being all that
familiar with them. It would be nice for generic code to go in client/bin
(or client/common_lib).

-- John

On Thu, Dec 30, 2010 at 10:39 AM, Lucas Meneghel Rodrigues
<[email protected]>wrote:

> Copying John. John, do you have any opinions about this module namespace
> thing?
>
> On Thu, 2010-12-30 at 16:33 -0200, Eduardo Habkost wrote:
> > On Thu, Dec 30, 2010 at 03:16:56PM -0200, Lucas Meneghel Rodrigues wrote:
> > > Hi folks, after some discussion we had I'd like to update the proposal
> > > of moving the current kvm autotest only libraries to a shared location
> > > inside autotest. Differences from the previous proposal:
> > >
> > > * Put the new packages under client directory instead of client/bin.
> > > * Have a kvm package for code that is far too kvm specific
> > >
> > > So this is what we envision for the code organization (hope the short,
> > > condensed version is easy enough to understand):
> > >
> > > Libraries with very specific kvm code:
> > >
> > > from autotest_lib.client.kvm import monitor
> > > from autotest_lib.client.kvm import installer
> > >
> > > Libraries shared by several hypervisors testing:
> > >
> > > I propose to merge the library that is going to hold the environment
> > > class and the pre/postprocessing code as:
> > >
> > > from autotest_lib.client.virt import env
> > >
> > > Other libs:
> > >
> > > from autotest_lib.client.virt import scheduler
> > > from autotest_lib.client.virt import utils
> > > from autotest_lib.client.virt import test_utils
> > > from autotest_lib.client.virt import vm
> > > from autotest_lib.client.virt import rss_client
> >
> > Looks better to me. Not perfect (the length of the module paths still
> > bother me), but I guess we don't have much flexibility to create generic
> > helper modules/packages inside autotest_lib (outside the client dir).
> >
> > >
> > > Libraries that can be used by all client side tests
> > >
> > > from autotest_lib.client.bin import test_config
> > > from autotest_lib.client.bin import subprocess
> >
> > I am still wondering why we use the "bin" subdirectory instead of just
> > using, e.g. "autotest_lib.client.subprocess".
> >
> > My opinion is that as autotest_lib.client is a Python package, we
> > shouldn't be afraid to add modules or packages inside it. Code
> > maintainability and readability (in this case, due to a saner module
> > namespace) seems to be more important to me than keeping the number of
> > files inside the 'client' directory small. I don't know what others
> > think.
> >
>
>
>
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to