diff options
| author | Donald Stufft <donald@stufft.io> | 2014-09-04 21:04:06 -0400 |
|---|---|---|
| committer | Donald Stufft <donald@stufft.io> | 2014-09-25 20:55:27 -0400 |
| commit | 9382fa0c05e533400613e1c7c0a777cabb463390 (patch) | |
| tree | 7cd6f6aebf57ea3b4760cc359b4d4c266a0e04f0 /setuptools/command/egg_info.py | |
| parent | 84c9006110e53c84296a05741edb7b9edd305f12 (diff) | |
| download | python-setuptools-git-9382fa0c05e533400613e1c7c0a777cabb463390.tar.gz | |
Implement PEP 440 by using the packaging library
Diffstat (limited to 'setuptools/command/egg_info.py')
| -rwxr-xr-x | setuptools/command/egg_info.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 72493d0b..cb67255b 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -15,6 +15,7 @@ from setuptools.command.sdist import sdist from setuptools.compat import basestring, PY3, StringIO from setuptools import svn_utils from setuptools.command.sdist import walk_revctrl +from setuptools._vendor.packaging.version import Version from pkg_resources import ( parse_requirements, safe_name, parse_version, safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename) @@ -68,9 +69,14 @@ class egg_info(Command): self.vtags = self.tags() self.egg_version = self.tagged_version() + parsed_version = parse_version(self.egg_version) + try: + spec = ( + "%s==%s" if isinstance(parsed_version, Version) else "%s===%s" + ) list( - parse_requirements('%s==%s' % (self.egg_name, + parse_requirements(spec % (self.egg_name, self.egg_version)) ) except ValueError: |
