Commit 20ac4827 authored by Jason R. Coombs's avatar Jason R. Coombs

Merge pull request #20 from dstufft/dont-warn-empty

Don't warn on empty non PEP 440 versions
parents 4bf1bfad 6d98caab
......@@ -2415,11 +2415,19 @@ class Distribution(object):
self._parsed_version = parse_version(self.version)
if isinstance(
self._parsed_version, packaging.version.LegacyVersion):
# While an empty version is techincally a legacy version and
# is not a valid PEP 440 version, it's also unlikely to
# actually come from someone and instead it is more likely that
# it comes from setuptools attempting to parse a filename and
# including it in the list. So for that we'll gate this warning
# on if the version is anything at all or not.
if self.version:
warnings.warn(
"'%s (%s)' is being parsed as a legacy, non PEP 440, "
"version. You may find odd behavior and sort order. In "
"particular it will be sorted as less than 0.0. It is "
"recommend to migrate to PEP 440 compatible versions." % (
"version. You may find odd behavior and sort order. "
"In particular it will be sorted as less than 0.0. It "
"is recommend to migrate to PEP 440 compatible "
"versions." % (
self.project_name, self.version,
),
RuntimeWarning,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment