How should multiple (related) projects be arranged (structured) and configured so that they can share code, have a related package structure and enable proper unittesting, and ensuring no namespace collisions

Fabio Zadrozny fabiofz at gmail.com
Fri Apr 21 08:10:28 EDT 2006


>
>
> COMMON
> src
>         a.b.c.common
> test
>         a.b.c.common


Ok, first thing... it won't work becaus as soon as python finds the first
a.b.c.common it will bail on the other... That's the default approach for
java, becase it will give you access to module-level things declared as
'default', that otherwise you wouldn't have access (in python all are
grown-ups, so that's not necessary) and it won't bail out in the first
match. So, in python, you'd probably do something as: test/test.a.b.c.common
or create a tests dir as src/a.b.c.common.tests (I guess there are other
solutions, but those 2 seem more appealing to me -- coming from a java
background).

I believe you'd be able to keep that structure and play with the pythonpath
if you wanted, but it could be too brittle in the end, and lead to
hard-to-discover problems.

Cheers,

Fabio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060421/ee999798/attachment.html>


More information about the Python-list mailing list