diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-10-17 11:54:14 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-10-17 11:54:14 -0400 |
| commit | b7c83dad9e11fbbc2a69fcc5fc26d4c7d1f5551f (patch) | |
| tree | 6e44ffdf5ee615d3a845106e3a51c172b2dedce0 /setuptools/command/egg_info.py | |
| parent | b66e45a90e82c9170cc48f21e4dac9d206193953 (diff) | |
| parent | 61e61296d9537c3e82516611ec283e42b1ed0466 (diff) | |
| download | python-setuptools-git-b7c83dad9e11fbbc2a69fcc5fc26d4c7d1f5551f.tar.gz | |
Merge branch 'master' into patch-1
Diffstat (limited to 'setuptools/command/egg_info.py')
| -rw-r--r-- | setuptools/command/egg_info.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index c957154a..0b7ad677 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -123,12 +123,17 @@ class InfoCommon: return safe_name(self.distribution.get_name()) def tagged_version(self): - version = self.distribution.get_version() - # egg_info may be called more than once for a distribution, - # in which case the version string already contains all tags. - if self.vtags and version.endswith(self.vtags): - return safe_version(version) - return safe_version(version + self.vtags) + return safe_version(self._maybe_tag(self.distribution.get_version())) + + def _maybe_tag(self, version): + """ + egg_info may be called more than once for a distribution, + in which case the version string already contains all tags. + """ + return ( + version if self.vtags and version.endswith(self.vtags) + else version + self.vtags + ) def tags(self): version = '' |
