aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorJunhan Huang <robinhuang@172-2-0-43.lightspeed.dybhfl.sbcglobal.net>2018-10-27 16:26:51 -0400
committerPaul Ganssle <paul@ganssle.io>2018-10-28 17:43:24 -0400
commit5854b0eba03dd257e30efff68f1632bdec5f0416 (patch)
tree4fa6de7fd235f29e5aca82c86da88d83651f9516 /setuptools/command/egg_info.py
parent29f9cb087fd107f412e2a2f0df877e3b14a75be9 (diff)
downloadexternal_python_setuptools-5854b0eba03dd257e30efff68f1632bdec5f0416.tar.gz
external_python_setuptools-5854b0eba03dd257e30efff68f1632bdec5f0416.tar.bz2
external_python_setuptools-5854b0eba03dd257e30efff68f1632bdec5f0416.zip
Add custom deprecation warning classes
`DeprecationWarning` is not visible by default in the latest versions of CPython, so this switches the deprecation warnings in setuptools and pkg_resources over to custom classes derived from `Warning` instead. Fixes issue github issue #159 Co-authored-by: Junhan Huang <robin.j.huang@gmail.com> Co-authored-by: Marton Pono <marci93@gmail.com>
Diffstat (limited to 'setuptools/command/egg_info.py')
-rw-r--r--setuptools/command/egg_info.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index bd116e1f..e1022d31 100644
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -31,7 +31,7 @@ import setuptools.unicode_utils as unicode_utils
from setuptools.glob import glob
from setuptools.extern import packaging
-
+from setuptools import SetuptoolsDeprecationWarning
def translate_pattern(glob):
"""
@@ -696,7 +696,7 @@ def get_pkg_info_revision():
Get a -r### off of PKG-INFO Version in case this is an sdist of
a subversion revision.
"""
- warnings.warn("get_pkg_info_revision is deprecated.", DeprecationWarning)
+ warnings.warn("get_pkg_info_revision is deprecated.", EggInfoDeprecationWarning)
if os.path.exists('PKG-INFO'):
with io.open('PKG-INFO') as f:
for line in f:
@@ -704,3 +704,7 @@ def get_pkg_info_revision():
if match:
return int(match.group(1))
return 0
+
+
+class EggInfoDeprecationWarning(SetuptoolsDeprecationWarning):
+ """Class for warning about deprecations in eggInfo in setupTools. Not ignored by default, unlike DeprecationWarning."""