Project organisation
rony steelandt
bucodi at yahoo.fr
Wed Jul 19 12:02:54 EDT 2006
Le Wed, 19 Jul 2006 14:31:06 +0100, Phil Thompson a écrit :
> On Wednesday 19 July 2006 3:12 pm, rony steelandt wrote:
>> Imagine I have x projects and they all use util.py
>>
>> What would be the best way to organise this
>>
>> 1.
>> c --\project1\*.py
>>
>> |-\project2\*.py
>>
>> --\globals\util.py
>>
>> This organisation has the problem that if I have to modify something to
>> util.py that I need in project2, I'll have to retest project1 to make sure
>> it still works (that could be project 1..n).
>>
>> 2.
>> A copy of util.py in each project directory ? The advantage is that I can
>> modify each util.py in function of the need of the project but it looks
>> clutered, having n versions of util.py.
>>
>> What is the best solution ? or is there another even better solution ?
>
> You could introduce version numbers to your module hierarchy...
>
> --\globals\v1-0\util.py
> \v1-1\util.py
> \v2-0\utill.py
>
> ...then in your code do something like...
>
> from globals.v1-0 import util
>
> ...which would allow some sharing without needing to retest.
>
> Phil
Yes, this actually looks like a very good idea, without the need of
retesting everything
Rony
More information about the Python-list
mailing list