Can't get "development mode" work as I like it
Hi, I'm used to develop and test from within a single project-directory, without any staging area, etc. As long as I did use scripts, this worked very well. But when switching to pkg_resources entry-points, I get problems: Now I need to ask easy_install (or setup.py develop ...) to create the "scripts" for me. Running python setup.py develop --install-dir . --script-dir . gives an "error: bad install directory or PYTHONPATH" since the current directory is not in PYTHONPATH. I tried other options, too, eg. adding "--editable -b . -N", but with no success. (This very one works as expected, but creates a *.egg-link file which will make the next install recurse until dead.) How can I make easy_install/distribute to generate only the scripts in the current directory? A typical setup for me looks like this: project-a/ setup.py README my_package/ __init__.py ... more stuff ... And I'm working like this: cd project-a # edit my_package/__init__.py ./my-script -- Schönen Gruß - Regards Hartmut Goebel Dipl.-Informatiker (univ.), CISSP, CSSLP Goebel Consult Spezialist für IT-Sicherheit in komplexen Umgebungen http://www.goebel-consult.de Monatliche Kolumne: http://www.cissp-gefluester.de/ Goebel Consult mit Mitglied bei http://www.7-it.de
At 05:43 PM 7/9/2010 +0200, Hartmut Goebel wrote:
Hi,
I'm used to develop and test from within a single project-directory, without any staging area, etc. As long as I did use scripts, this worked very well. But when switching to pkg_resources entry-points, I get problems: Now I need to ask easy_install (or setup.py develop ...) to create the "scripts" for me.
Running
python setup.py develop --install-dir . --script-dir .
gives an "error: bad install directory or PYTHONPATH" since the current directory is not in PYTHONPATH.
Installation to the current directory isn't supported, as it's rather a bad idea (for one thing, you could accidentally overwrite something). My suggestion would be: mkdir bin python setup.py develop -md bin bin/scriptname (to run a script) Notice that the use of the -m flag means that the 'bin' directory doesn't have to be on PYTHONPATH for this to work. There will simply be an .egg-link file placed there, along with your scripts.
participants (2)
-
Hartmut Goebel
-
P.J. Eby