Re: [Distutils] Side by side debug/non-debug eggs

At 09:45 AM 5/22/2009 -0400, Jean-Paul Calderone wrote:
Hello all,
Prior to eggs, if I wanted to have debug and non-debug versions of an extension module available, I could build and install the extension twice and the modules would happily co-exist, for example:
$ python setup.py build install ... $ python-dbg setup.py build install ... $ .../site-packages/twisted/python$ ls *.so _epoll_d.so _epoll.so $ .../site-packages/twisted/python$ If I then ran a debug build of Python, the debug extension would be loaded. When I ran a normal build of Python, the non-debug extension would be loaded. However, with eggs, each new egg completely replaces the last egg. There seems to be no possibility for side-by-side builds. Am I overlooking a feature of eggs or of setuptools?
Have you tried "setup.py develop"? This builds extensions in-place in the source tree and adds the source tree to sys.path.

On Fri, 22 May 2009 11:33:54 -0400, "P.J. Eby" <pje@telecommunity.com> wrote:
At 09:45 AM 5/22/2009 -0400, Jean-Paul Calderone wrote:
Hello all,
Prior to eggs, if I wanted to have debug and non-debug versions of an extension module available, I could build and install the extension twice and the modules would happily co-exist, for example:
$ python setup.py build install ... $ python-dbg setup.py build install ... $ .../site-packages/twisted/python$ ls *.so _epoll_d.so _epoll.so $ .../site-packages/twisted/python$ If I then ran a debug build of Python, the debug extension would be loaded. When I ran a normal build of Python, the non-debug extension would be loaded. However, with eggs, each new egg completely replaces the last egg. There seems to be no possibility for side-by-side builds. Am I overlooking a feature of eggs or of setuptools?
Have you tried "setup.py develop"? This builds extensions in-place in the source tree and adds the source tree to sys.path.
Aware of it, but I haven't tried it. In this use, it sounds very similar to "setup.py build_ext -i", which also partially solves the problem. Unfortunately, some packages have their source laid out such that they cannot actually be used in-place, only after they've been installed. Thanks, Jean-Paul

Jean-Paul Calderone wrote:
On Fri, 22 May 2009 11:33:54 -0400, "P.J. Eby" <pje@telecommunity.com> wrote:
At 09:45 AM 5/22/2009 -0400, Jean-Paul Calderone wrote:
Hello all,
Prior to eggs, if I wanted to have debug and non-debug versions of an extension module available, I could build and install the extension twice and the modules would happily co-exist, for example:
$ python setup.py build install ... $ python-dbg setup.py build install ... $ .../site-packages/twisted/python$ ls *.so _epoll_d.so _epoll.so $ .../site-packages/twisted/python$ If I then ran a debug build of Python, the debug extension would be loaded. When I ran a normal build of Python, the non-debug extension would be loaded. However, with eggs, each new egg completely replaces the last egg. There seems to be no possibility for side-by-side builds. Am I overlooking a feature of eggs or of setuptools?
Have you tried "setup.py develop"? This builds extensions in-place in the source tree and adds the source tree to sys.path.
Aware of it, but I haven't tried it. In this use, it sounds very similar to "setup.py build_ext -i", which also partially solves the problem. Unfortunately, some packages have their source laid out such that they cannot actually be used in-place, only after they've been installed.
A data point: I've been using "setup.py develop" with twisted for over a year now, and it works great for me -- definitely one of my favorite features of setuptools. I use it with an svn checkout of twisted so I can always use the latest -- especially nice with twisted because of its high quality management (trunk is almost never broken). That way I can easily track the latest version -- just do an svn update, no further installation required. When I want to try a vcs checkout of an immature package and its setup.py uses distutils instead of setuptools, I'll try changing its setup.py to use setuptools (usually a one or two line replacement of the import) and see if "setup.py develop" works, and it almost always does. Steve

On Fri, 22 May 2009 12:53:40 -0400, Stephen Waterbury <stephen.c.waterbury@nasa.gov> wrote:
[snip]
A data point: I've been using "setup.py develop" with twisted for over a year now, and it works great for me -- definitely one of my favorite features of setuptools. I use it with an svn checkout of twisted so I can always use the latest -- especially nice with twisted because of its high quality management (trunk is almost never broken). That way I can easily track the latest version -- just do an svn update, no further installation required.
When I want to try a vcs checkout of an immature package and its setup.py uses distutils instead of setuptools, I'll try changing its setup.py to use setuptools (usually a one or two line replacement of the import) and see if "setup.py develop" works, and it almost always does.
Hi Steve, Yea, I would expect it to work alright with Twisted. The project I ran into this with is clearsilver, which it doesn't work with, and another project I had in mind when I wrote about this problem is pyOpenSSL, which is also laid out in its repository such that it cannot be used in-place. :( Jean-Paul
participants (3)
-
Jean-Paul Calderone
-
P.J. Eby
-
Stephen Waterbury