Help making setuptools install more like plain distutils one

Hello, We have a setup where a central /usr/local is copied to all our machines. The packages installed in said central /usr/local are managed via stow. (Basically, each package is installed in a separate directory under /usr/local/stow, and invoking the stow command creates symlinks to make the package appear under /usr/local.) This works very well for a wide range of packages: autoconf packages, CRAN packages for R, etc. This includes plain distutils python packages (install via "python setup.py install --prefix /usr/local/stow/some-package-name", then run stow). The only exception is setuptools-based python packages. Is there a way to ask setuptools to do an install that looks more like a standard distutils install? I don't care if I lose some the advanced setuptools features. Basically, I need an install that's done via just copying new files. Problems like setuptoosl checking that the destination directory is in the PYTHONPATH I can work around (although if there's a switch to disable that check, I'd be happy to learn about it). The main problem is the file that's edited on each install to add a new line for each package install via setuptools. Is there a way with setuptools of getting just a directory tree (or a tarball, etc.) that either setuptools or myself can just copy somewhere to have an installed python module? Thanks in advance for any help, Christian

Use --single-version-externally-managed (also pip using this flag by default, so if you install via pip you'll get this behavior). On Mon, Apr 20, 2009 at 12:28 PM, Christian Hudon <chrish@apstat.com> wrote:
Hello,
We have a setup where a central /usr/local is copied to all our machines. The packages installed in said central /usr/local are managed via stow. (Basically, each package is installed in a separate directory under /usr/local/stow, and invoking the stow command creates symlinks to make the package appear under /usr/local.)
This works very well for a wide range of packages: autoconf packages, CRAN packages for R, etc. This includes plain distutils python packages (install via "python setup.py install --prefix /usr/local/stow/some-package-name", then run stow). The only exception is setuptools-based python packages.
Is there a way to ask setuptools to do an install that looks more like a standard distutils install? I don't care if I lose some the advanced setuptools features. Basically, I need an install that's done via just copying new files. Problems like setuptoosl checking that the destination directory is in the PYTHONPATH I can work around (although if there's a switch to disable that check, I'd be happy to learn about it). The main problem is the file that's edited on each install to add a new line for each package install via setuptools. Is there a way with setuptools of getting just a directory tree (or a tarball, etc.) that either setuptools or myself can just copy somewhere to have an installed python module?
Thanks in advance for any help,
Christian
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Ian Bicking | http://blog.ianbicking.org

At 01:28 PM 4/20/2009 -0400, Christian Hudon wrote:
Is there a way to ask setuptools to do an install that looks more like a standard distutils install?
Yes, use "setup.py install --single-version-externally-managed --record=/some/file". This will install the distutils way, and record all the installed files in /some/file (which you can then discard if you like).
I don't care if I lose some the advanced setuptools features. Basically, I need an install that's done via just copying new files. Problems like setuptoosl checking that the destination directory is in the PYTHONPATH I can work around (although if there's a switch to disable that check, I'd be happy to learn about it). The main problem is the file that's edited on each install to add a new line for each package install via setuptools. Is there a way with setuptools of getting just a directory tree (or a tarball, etc.) that either setuptools or myself can just copy somewhere to have an installed python module?
"setup.py bdist_dumb" is probably what you want for that. It will work pretty much identically with both distutils and setuptools.

At 01:28 PM 4/20/2009 -0400, Christian Hudon wrote:
Is there a way to ask setuptools to do an install that looks more like a standard distutils install?
Yes, use "setup.py install --single-version-externally-managed --record=/some/file". This will install the distutils way, and record all the installed files in /some/file (which you can then discard if you like). Thanks for the answers. I looked at both options, and the --single-version-externally-managed one would be easier for me: compared to the bdist_dumb, it saves me the steps of finding and untarring the tarball. Also, the bdist_dumb commands creates tarballs that can be untarred at "/" (they contain /usr, etc.) while I would need something more like the equivalent of what --prefix does (tarball that start with
P.J. Eby wrote: lib, etc. that can be untarred in /usr/local or /usr...) The only thing I'd need would be way to reliably determine if I'm dealing with setuptools-based setup.py or not. I can always call "python setup.py installl --help" and look if --single-version-externally-managed is present in the output. Is there a cleaner version of doing this? Thanks for the help, Christian

On 2009-04-20 15:49, Christian Hudon wrote:
The only thing I'd need would be way to reliably determine if I'm dealing with setuptools-based setup.py or not. I can always call "python setup.py installl --help" and look if --single-version-externally-managed is present in the output. Is there a cleaner version of doing this?
You could ensure that you always have a setuptools-based setup.py: python -c "import setuptools; execfile('setup.py')" install --single-version-..... -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Robert Kern wrote:
On 2009-04-20 15:49, Christian Hudon wrote:
The only thing I'd need would be way to reliably determine if I'm dealing with setuptools-based setup.py or not. I can always call "python setup.py installl --help" and look if --single-version-externally-managed is present in the output. Is there a cleaner version of doing this?
You could ensure that you always have a setuptools-based setup.py:
python -c "import setuptools; execfile('setup.py')" install --single-version-.....
Tried it. It works great! Wouldn't have thought of that... Thanks! Christian
participants (4)
-
Christian Hudon
-
Ian Bicking
-
P.J. Eby
-
Robert Kern