[Python-checkins] peps: Another improvement by Nick: a better description of splitting portions among

eric.smith python-checkins at python.org
Fri Apr 20 12:20:30 CEST 2012


http://hg.python.org/peps/rev/139de1b8f702
changeset:   4284:139de1b8f702
user:        Eric V. Smith <eric at trueblade.com>
date:        Fri Apr 20 06:20:24 2012 -0400
summary:
  Another improvement by Nick: a better description of splitting portions among multiple directories.

files:
  pep-0420.txt |  27 ++++++++++++++-------------
  1 files changed, 14 insertions(+), 13 deletions(-)


diff --git a/pep-0420.txt b/pep-0420.txt
--- a/pep-0420.txt
+++ b/pep-0420.txt
@@ -84,19 +84,20 @@
 supports adding portions to its _namespace_packages variable, whereas
 pkgutil doesn't.
 
-Namespace packages need to be installed in one of two ways: either all
-portions of a namespace will be combined into a single directory (and
-therefore a single entry in sys.path), or each portion will be
-installed in its own directory (and each portion will have a distinct
-sys.path entry).
-
-The current imperative approach causes problems for system vendors.
-Vendor packages typically must not provide overlapping files, and an
-attempt to install a vendor package that has a file already on disk
-will fail or cause unpredictable behavior. As vendors might choose to
-package distributions such that they will end up all in a single
-directory for the namespace package, all portions would contribute
-conflicting __init__.py files.
+Namespace packages are designed to support being split across multiple
+directories (and hence found via multiple sys.path entries).  In this
+configuration, it doesn't matter if multiple portions all provide an
+``__init__.py`` file, so long as each portion correctly initializes
+the namespace package. However, Linux distribution vendors (amongst
+others) prefer to combine the separate portions and install them all
+into the *same* filesystem directory. This creates a potential for
+conflict, as the portions are now attempting to provide the *same*
+file on the target system - something that is not allowed by many
+package managers. Allowing implicit namespace packages means that the
+requirement to provide an ``__init__.py`` file can be dropped
+completely, and affected portions can be installed into a common
+directory or split across multiple directories as distributions see
+fit.
 
 Specification
 =============

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


More information about the Python-checkins mailing list