Re: [Distutils] ..\setup.py relative invocation (was: [issue108] develop install fails if path to setup.py is relative)
At 03:21 PM 5/9/2010 +0300, anatoly techtonik wrote:
setup.py fails miserably when invoked using relative path, i.e. `python ../../setup.py ...`. In this case it attempts to look up referenced files in current directory - not in its own dir.
What is it needed for?
The distutils were simply written with the assumption that that's how things are... and there were never any tests that did otherwise. As a result, there's lots of code that simply operates on relative paths, beginning from the relative paths that are provided by setup().
Does distutils2 fix this?
I ask, because it adds another "save cwd;cd;...;restore cwd" yak shaving wrapper to development process, and the error message for failure is not very intuitive.
FWIW, you can always use "easy_install path/to/directory", if you're just going to be running an install. I don't know if pip will wrap in this way, but it seems to me there was also a buildutils or some such package floating around a few years ago that included a simple command for running setup scripts with different interpreters, in any directory, etc.
Does distutils2 fix this?
I ask, because it adds another "save cwd;cd;...;restore cwd" yak shaving wrapper to development process, and the error message for failure is not very intuitive.
You could also use a subshell (i.e. ”(cd somewhere && ./setup.py cmd)”) but that’s also an ugly workaround. make has a -C option that takes as argument the directory to cd to before running. Would something like that be ok? Regards
On Sun, May 9, 2010 at 1:52 PM, Éric Araujo <merwok@netwok.org> wrote:
make has a -C option that takes as argument the directory to cd to before running. Would something like that be ok?
As long as there's a setup.py, cd'ing to that directory seems better than requiring more of the end user. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller
participants (3)
-
Fred Drake
-
P.J. Eby
-
Éric Araujo