[Python-checkins] peps: Tweak PEP 426 install hooks

nick.coghlan python-checkins at python.org
Thu Jun 20 13:45:46 CEST 2013

changeset:   4951:535f09e95d89
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Thu Jun 20 21:44:51 2013 +1000
  Tweak PEP 426 install hooks

  pep-0426.txt |  30 +++++++++++++++++++++++++++---
  1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/pep-0426.txt b/pep-0426.txt
--- a/pep-0426.txt
+++ b/pep-0426.txt
@@ -778,9 +778,6 @@
 * ``license``: a file with the full text of the distribution's license
 * ``changelog``: a file describing changes made to the distribution
-If this field is provided at all, it MUST name at least one included
 Supporting documents MUST be included directly in the ``dist-info``
 directory. Directory separators are NOT permitted in document names.
@@ -1566,6 +1563,13 @@
 that the ``setup.py`` script will already invoke any necessary
 post-installation behaviour.
+Installation tools SHOULD treat an exception thrown by a postinstall hook
+as a failure of the installation and revert any other changes made to the
+Installation tools SHOULD treat an exception thrown by a preuninstall hook
+as an indication the removal of the distribution should be aborted.
 Installation tools MUST NOT silently ignore install hooks, as failing
 to call these hooks may result in a misconfigured installation that fails
 unexpectedly at runtime. Installation tools MAY refuse to install
@@ -2225,6 +2229,26 @@
 (at the earliest).
+Additional install hooks
+In addition to the postinstall and preuninstall hooks described in the PEP,
+other distribution systems (like RPM) include the notion of preinstall
+and postuninstall hooks. These hooks would run with the runtime dependencies
+installed, but without the distribution itself. These have been deliberately
+omitted, as they're well suited to being explored further as metadata
+Similarly, the idea of "optional" postinstall and preuninstall hooks can
+be pursued as a metadata extension.
+By contrast, the mandatory postinstall and preuninstall hooks have been
+included directly in the PEP, specifically to ensure installation tools
+don't silently ignore them. This ensures users will either be able to
+install such distributions, or else receive an explicit error at installation
 Metabuild system

Repository URL: http://hg.python.org/peps

More information about the Python-checkins mailing list