summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2014-12-17 20:52:37 -0500
committerDonald Stufft <donald@stufft.io>2014-12-18 08:28:16 -0500
commit20eb01f0cac85e0f6a280a8127a872572a53ec9b (patch)
tree59f0729d8da9e7d487d5cdd58f952ade3e2ac688
parent20ac482786bc7622f67df8ab13810fde9fd850ac (diff)
downloadpython-setuptools-git-20eb01f0cac85e0f6a280a8127a872572a53ec9b.tar.gz
Add a PEP440Warning to make it easier to silence these warnings
-rw-r--r--pkg_resources.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index f3ac6c50..87fd2782 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -80,6 +80,13 @@ import setuptools._vendor.packaging.specifiers
packaging = setuptools._vendor.packaging
+class PEP440Warning(RuntimeWarning):
+ """
+ Used when there is an issue with a version or specifier not complying with
+ PEP 440.
+ """
+
+
class _SetuptoolsVersionMixin(object):
def __hash__(self):
@@ -272,6 +279,9 @@ __all__ = [
'ResolutionError', 'VersionConflict', 'DistributionNotFound',
'UnknownExtra', 'ExtractionError',
+ # Warnings
+ 'PEP440Warning',
+
# Parsing functions and string utilities
'parse_requirements', 'parse_version', 'safe_name', 'safe_version',
'get_platform', 'compatible_platforms', 'yield_lines', 'split_sections',
@@ -2430,7 +2440,7 @@ class Distribution(object):
"versions." % (
self.project_name, self.version,
),
- RuntimeWarning,
+ PEP440Warning,
)
return self._parsed_version