From 5516e1cb739e2eab4754f40ebb63593c3efa6877 Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Thu, 20 Jun 2013 21:44:51 +1000 Subject: [PATCH] Tweak PEP 426 install hooks --- pep-0426.txt | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/pep-0426.txt b/pep-0426.txt index 4cc27cf14..0271edf41 100644 --- a/pep-0426.txt +++ b/pep-0426.txt @@ -778,9 +778,6 @@ The following supporting documents can be named: * ``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 -document. - Supporting documents MUST be included directly in the ``dist-info`` directory. Directory separators are NOT permitted in document names. @@ -1566,6 +1563,13 @@ installation tools MUST NOT invoke the install hooks - it is assumed 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 +system. + +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 @@ from wheels, so it is a good candidate for postponing to metadata 2.1 (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 +extensions. + +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 +time. + + Metabuild system ----------------