[Python-Dev] OT: single directory development [was Re: Playing with a new theme for the docs]

Ethan Furman ethan at stoneleaf.us
Wed Mar 28 03:02:48 CEST 2012


PJ Eby wrote:
> Really?  I've been doing "dump the app in a directory" since 1998 or so 
> on various *nix platforms.  And when distutils came along, I set up a 
> user-specific cfg to install in the same directory.  ISTR a 5-line 
> pydistutils.cfg is sufficient to make everything go into to a particular 
> directory, for packages using distutils for installation.

Perhaps somebody could clue me in on the best way to handle this scenario:

I develop in a single directory:

     c:\source\loom\
         loom.py
         test_loom.py

because test_loom could at some point be executed by somebody besides 
me, while living in site-packages, I have test_loom.py create its needed 
files, including dynamic test scripts, in a temp directory.  While this 
works fine for site-packages, it doesn't work at all while testing as 
the test script, being somewhere else, won't be able to load my test 
copy of loom.

I know I have at least two choices:
   - go with a virtualenv and have my development code be in the
     virtualenv site-packages
   - insert the current path into sys.path before calling out to
     the dynamic scripts, but only if the current path is not
     site-packages

Suggestions?

~Ethan~


More information about the Python-Dev mailing list