[Python-checkins] r72420 - peps/trunk/pep-0376.txt

tarek.ziade python-checkins at python.org
Thu May 7 11:02:23 CEST 2009


Author: tarek.ziade
Date: Thu May  7 11:02:23 2009
New Revision: 72420

Log:
removed the EGG_INFO_FILES part

Modified:
   peps/trunk/pep-0376.txt

Modified: peps/trunk/pep-0376.txt
==============================================================================
--- peps/trunk/pep-0376.txt	(original)
+++ peps/trunk/pep-0376.txt	Thu May  7 11:02:23 2009
@@ -149,19 +149,6 @@
 file, so the old `record` behavior will be deprecated. 
 XXX see how to handle old record (new option, or wait for 2 version?)
 
-Listing the .egg-info elements in Distutils
-===========================================
-
-In Distutils, the `dist` module will introduce an `EGG_INFO_FILES` constant 
-to list all files located in the `.egg-info` directory::
-
-    from collections import namedtuple
-
-    EggInfos = namedtuple('EggInfo', 'manifest record pkg_info')
-
-    # files added in egg-info    
-    EGG_INFO_FILES = EggInfos('RECORD', 'PKG-INFO')
-
 Back to our `zlib` example, we will have::
 
     - zlib
@@ -169,8 +156,6 @@
         PKG-INFO
         RECORD
 
-XXX See if we want to add Python version in the PKG-INFO
-
 New functions in pkgutil
 ========================
 
@@ -199,8 +184,6 @@
   Uses `get_egg_info` and gets any file inside the directory,
   pointed by filename.
 
-  filename can be any value found in `distutils.sdist.EGG_INFO_FILES`.
-
 Let's use it with our `zlib` example::
 
     >>> from pkgutil import get_egg_info, get_metadata, get_egg_info_file
@@ -209,15 +192,13 @@
     >>> metadata = get_metadata('zlib')
     >>> metadata.version
     '2.5.2'
-    >>> from distutils.dist import EGG_INFO_FILES
-    >>> get_egg_info_file('zlib', EGG_INFO_FILES.manifest).read()
+    >>> get_egg_info_file('zlib', 'PKG-INFO').read()
     some
     ...
     files
 
-
-Adding an Uninstall API
-=======================
+Adding an Uninstall function
+============================
 
 Distutils provides a very basic way to install a project, which is running
 the `install` command over the `setup.py` script of the distribution.
@@ -227,10 +208,15 @@
 mentioned in another `RECORD` file.
 
 This command will be added in the `util` module and will take the name
-of the project to uninstall::
+of the project to uninstall. A call to uninstall will return a list
+of uninstalled files. If the project is not found, a Distutils::
 
     >>> from distutils.util import uninstall
     >>> uninstall('zlib')
+    ['/opt/local/lib/python2.6/site-packages/zlib/file1',
+     '/opt/local/lib/python2.6/site-packages/zlib/file2']
+
+If the project is not found, a ``DistutilsUninstallError`` will be raised.
 
 To make it a reference API for third-party projects that wish to provide
 an `uninstall feature`. The `uninstall` API can also be invoked with a 
@@ -243,6 +229,7 @@
     ...     logging.info('Removing %s' % path)
     ...     return True
     >>> uninstall('zlib', _remove_and_log)
+
     >>> def _dry_run(path):
     ...     logging.info('Removing %s (dry run)' % path)
     ...     return False


More information about the Python-checkins mailing list