coding for multiple versions of python

Dave Angel davea at ieee.org
Fri Aug 14 10:53:35 EDT 2009


Grant Edwards wrote:
> On 2009-08-14, Martin v. L?wis <martin at v.loewis.de> wrote:
>
>   
>>> I'm guessing I need to configure cvs to copy files to both
>>> locations whenever I commit. Does that sound right? Is there a
>>> better way I'm not thinking of?
>>>       
>
> Just use one set of source files.
>
>   
>> If the set of files doesn't change too often, you can use symlinks.
>> That's how Debian currently installs Python packages for multiple
>> versions on a single system.
>>
>> Specifically, put the source code into /net/source/python/foo/*.py.
>> Then, on each system, put symlinks to all .py files into
>> lib/site-packages/foo. Then Python will place the .pyc files next
>> to the symlinks, not next to the actual .py files.
>>     
>
> Why would he need two sets of .py files?
>
>   
I can't speak for Martin, but his description doesn't have two sets of 
.py files, but two sets of symlinks pointing to the same .py files.  
It's the .pyc files that exist in two forms, since those are version 
dependent.

He's assuming:
    1) an OS that supports symlinks
    2) two versions of Python on same system
    3) one set of pure-python sources that want to stay in synch for 
both versions.





More information about the Python-list mailing list