The answer

Dave Angel davea at ieee.org
Mon Jan 18 06:03:52 EST 2010



Jive Dadson wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">alex23 
> wrote:
> >
> > Actually, if you're using Python 2.6+/3.x, you can effectively skip
> > steps 1-5, as these versions now support user site-packages.
> >
> > Rather than create a Module folder and modify your PYTHONPATH, add (if
> > it doesn't exist already) the following folder:
> > %APPDATA%/Python/Python26/site-packages
> >
> > Modules can sit directly in the folder, or within packages.
> >
> > For more details: http://www.python.org/dev/peps/pep-0370/
>
> That requires a directory whose name embeds the Python version number, 
> which is the evil from which I flee, or rather sought to flee.  
> Imagine if all your C++ code had to go into directories that were 
> named for some specific C++ compiler.  It's just WRONG.  It's a 
> maintenance nightmare to have a bunch of different source files that 
> all have to be updated whenever you fix a bug or add a feature.
>
>
As others have pointed out, you need a "deploy" script, which in your 
case would copy the files from source control to the appropriate 
production folder.  That's analogous to the compile, link and deploy 
steps of C++.  And if you want to be even more analogous, copy just the 
.pyc files, after building them.

Certainly you have lots more files in your version control system which 
are not intended to be copied to the "Modules" folder, such as the test 
suite.

DaveA




More information about the Python-list mailing list