diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-18 08:31:14 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-18 08:31:14 -0500 |
| commit | 0f1b7756bc8517c57031023ba669ee486c733dfd (patch) | |
| tree | 59f0729d8da9e7d487d5cdd58f952ade3e2ac688 | |
| parent | 20ac482786bc7622f67df8ab13810fde9fd850ac (diff) | |
| parent | 20eb01f0cac85e0f6a280a8127a872572a53ec9b (diff) | |
| download | python-setuptools-git-0f1b7756bc8517c57031023ba669ee486c733dfd.tar.gz | |
Merge pull request #21 from dstufft/subclass-warning
Add a PEP440Warning to make it easier to silence these warnings
| -rw-r--r-- | pkg_resources.py | 12 |
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 |
