[Python-checkins] cpython: Issue #27919: Deprecate extra_path option in distutils.

jason.coombs python-checkins at python.org
Thu Sep 1 13:56:00 EDT 2016


https://hg.python.org/cpython/rev/94710cbcac47
changeset:   102985:94710cbcac47
user:        Jason R. Coombs <jaraco at jaraco.com>
date:        Thu Sep 01 13:55:33 2016 -0400
summary:
  Issue #27919: Deprecate extra_path option in distutils.

files:
  Doc/whatsnew/3.6.rst             |  6 ++++++
  Lib/distutils/command/install.py |  6 ++++++
  Misc/NEWS                        |  3 +++
  3 files changed, 15 insertions(+), 0 deletions(-)


diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -782,6 +782,12 @@
   now deprecated.
   (Contributed by Serhiy Storchaka in :issue:`25791` and :issue:`26754`.)
 
+* The undocumented ``extra_path`` argument to a distutils Distribution
+  is now considered
+  deprecated, will raise a warning during install if set. Support for this
+  parameter will be dropped in a future Python release and likely earlier
+  through third party tools. See :issue:`27919` for details.
+
 
 Deprecated Python behavior
 --------------------------
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -175,6 +175,7 @@
         self.compile = None
         self.optimize = None
 
+        # Deprecated
         # These two are for putting non-packagized distributions into their
         # own directory and creating a .pth file if it makes sense.
         # 'extra_path' comes from the setup file; 'install_path_file' can
@@ -344,6 +345,7 @@
                            'scripts', 'data', 'headers',
                            'userbase', 'usersite')
 
+        # Deprecated
         # Well, we're not actually fully completely finalized yet: we still
         # have to deal with 'extra_path', which is the hack for allowing
         # non-packagized module distributions (hello, Numerical Python!) to
@@ -490,6 +492,10 @@
             self.extra_path = self.distribution.extra_path
 
         if self.extra_path is not None:
+            log.warn(
+                "Distribution option extra_path is deprecated. "
+                "See issue27919 for details."
+            )
             if isinstance(self.extra_path, str):
                 self.extra_path = self.extra_path.split(',')
 
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -60,6 +60,9 @@
 Library
 -------
 
+- Issue #27919: Deprecated ``extra_path`` distribution option in distutils
+  packaging.
+
 - Issue #23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to
   match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and
   ``cmath.nanj`` to match the format used by complex repr.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list