[Python-checkins] python/nondist/sandbox/setuptools EasyInstall.txt, 1.55, 1.56 setuptools.txt, 1.33, 1.34

pje@users.sourceforge.net pje at users.sourceforge.net
Tue Aug 23 15:24:52 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28556

Modified Files:
	EasyInstall.txt setuptools.txt 
Log Message:
Simplify non-root install process and improve Mac OS docs for it.  Support
.pth files and legacy packages possibly being symlinks, and ensure that
overwrites don't follow the symlink.


Index: EasyInstall.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/EasyInstall.txt,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- EasyInstall.txt	22 Aug 2005 03:53:42 -0000	1.55
+++ EasyInstall.txt	23 Aug 2005 13:24:39 -0000	1.56
@@ -673,15 +673,22 @@
 
 If you want to use EasyInstall on a computer where you do not have write access
 to Python's main ``site-packages`` directory, you may need to set up an
-alternate ``PYTHONHOME`` location, which allows Python to read a second
-``site-packages`` directory.
+alternate "home" location for Python, so that it uses a personal
+``site-packages`` directory instead of the system-wide ``site-packages``.
 
 If you are on a Mac OS X machine, you should just use the
 ``~/Library/Python2.x/site-packages`` directory (replacing the ``x`` with the
 appropriate number).  Just make sure the directory exists, and use it as your
-installation location for all packages (including EasyInstall itself).  You
-do not need to set up a ``PYTHONHOME``, so you can skip the rest of this
-section, unless you want to be able to override system-installed packages.
+installation location for all packages (including EasyInstall itself).  To
+make the distutils install to this personal ``site-packages`` directory by
+default, you should create a ``~/.pydistutils.cfg`` file with the following
+contents::
+
+    [install]
+    install_lib = ~/Library/Python$py_version_short/site-packages
+
+This will tell the distutils (and EasyInstall) to always install packages in
+the appropriate personal ``site-packages`` directory.
 
 If you are on a Linux, BSD, Cygwin, or other similar Unix-like operating
 system, you should create a ``~/lib/python2.x/site-packages`` directory
@@ -694,39 +701,40 @@
 
 Assuming your ``sys.prefix`` is ``/usr/local``, and you are working with
 Python 2.4, you need to then perform the following steps (possibly making
-adjustments for the tools available on your platform)::
+adjustments for the tools available on your platform).  First, you need
+to set up the local library directories, by symlinking to the system Python's
+libraries::
 
-    cd /usr/local/lib/python2.4  
-    find . -name lib-dynload -prune -o -name site-packages -prune -o \
-        -print >~/pyfiles
-    zip -r ~/lib/python24.zip . -i@$HOME/pyfiles
-    rm ~/pyfiles
-    mkdir -p ~/lib/python2.4/site-packages
-    ln -s /usr/local/lib/python2.4/lib-* ~/lib/python2.4/
+    mkdir -p ~/lib/python2.4
+    ln -s /usr/local/lib/python2.4/* ~/lib/python2.4/
+    rm ~/lib/python2.4/site-packages
+    mkdir ~/lib/python2.4/site-packages
+    ln -s /usr/local/lib/python2.4/site-packages/* ~/lib/python2.4/site-packages
 
-    echo "[install]" >>~/.pydistutils.cfg
-    echo "prefix=$HOME" >>~/.pydistutils.cfg
-    echo "exec_prefix=$HOME" >>~/.pydistutils.cfg
+If your ``sys.exec_prefix`` was different from your ``sys.prefix``, you will
+also need to do this::
 
-Note that all of the paths above should be based on ``sys.prefix``, not
-``sys.exec_prefix`` (unless they're the same).  Once these one-time steps are
-completed, you can set your ``PYTHONHOME`` with::
+    ln -s /execprefix/lib/python2.4/* ~/lib/python2.4/
 
-    export PYTHONHOME=$HOME:/old_exec_prefix
+replacing ``execprefix`` in the above with the value of ``sys.exec_prefix``.
 
-replacing ``/old_exec_prefix`` with the original value of ``sys.exec_prefix``.
+Finally, you will also need a private ``python`` executable, e.g.::
 
-The downside to this setup is that it can take up as much as 10 megabytes of
-disk space to store the zipped standard library.  The upside, however, is that
-Python usually starts much faster with a zipped standard library! And of
-course, you'll effectively have complete control over your own Python
-installation, without needing to convince a system administrator to install
-packages for you.
+    mkdir -p ~/bin
+    ln /usr/local/bin/python2.4 ~/bin/python
+
+Note that if hardlinking as shown doesn't work (e.g. because the system Python
+is on a different filesystem), you should use ``copy -p`` instead of ``ln``.
+Do NOT use a symlink; the Python binary must be copied or hardlinked, otherwise
+it will use the system ``site-packages`` directory and not yours.
 
 Note that if you were previously setting a ``PYTHONPATH`` and/or had other
 special configuration options in your ``~/.pydistutils.cfg``, you may need to
 remove these settings, after relocating any older installed modules to your
-new ``~/lib/python2.x`` directory.
+new ``~/lib/python2.x/site-packages`` directory.  Also note that you must now
+make sure to use the ``~/bin/python`` executable instead of the system Python,
+and ideally you should put ``~/bin`` first on your ``PATH`` as well, because
+that is where EasyInstall will install new Python scripts.
 
 
 Release Notes/Change History

Index: setuptools.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools.txt,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- setuptools.txt	22 Aug 2005 03:40:20 -0000	1.33
+++ setuptools.txt	23 Aug 2005 13:24:40 -0000	1.34
@@ -10,7 +10,7 @@
 ordinary Python packages based on the ``distutils``.  Your users don't need to
 install or even know about setuptools in order to use them, and you don't
 have to include the entire setuptools package in your distributions.  By
-including just a single `bootstrap module`_ (a 5K .py file), your package will
+including just a single `bootstrap module`_ (a 7K .py file), your package will
 automatically download and install ``setuptools`` if the user is building your
 package from source and doesn't have a suitable version already installed.
 



More information about the Python-checkins mailing list