Commit fb3d832a authored by Jason R. Coombs's avatar Jason R. Coombs

Merge pull request #15 from dstufft/add-warning

Add a warning when version is parsed as legacy
parents fa32ede0 68bcfecf
......@@ -2413,6 +2413,17 @@ class Distribution(object):
def parsed_version(self):
if not hasattr(self, "_parsed_version"):
self._parsed_version = parse_version(self.version)
if isinstance(
self._parsed_version, packaging.version.LegacyVersion):
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." % (
self.project_name, self.version,
),
RuntimeWarning,
)
return self._parsed_version
......
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