summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Ingram <di@users.noreply.github.com>2021-01-15 14:19:14 -0600
committerDustin Ingram <di@users.noreply.github.com>2021-01-15 14:28:14 -0600
commited07f8b124f75b43e27e5d636484898476a0be4f (patch)
tree2d675340912066fa1d03caefc9ebd5c6dc11caea
parent2788dbf93ee8e3d86f7bc86ec6ffc79c7a4643c8 (diff)
downloadpython-setuptools-git-fix/2529.tar.gz
Correctly handle normalized tagsfix/2529
-rw-r--r--changelog.d/2529.change.rst1
-rw-r--r--setuptools/command/egg_info.py10
2 files changed, 7 insertions, 4 deletions
diff --git a/changelog.d/2529.change.rst b/changelog.d/2529.change.rst
new file mode 100644
index 00000000..10c41518
--- /dev/null
+++ b/changelog.d/2529.change.rst
@@ -0,0 +1 @@
+Fixed an issue where version tags may be added multiple times
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 0b7ad677..066c2488 100644
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -130,10 +130,12 @@ class InfoCommon:
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
- )
+ # Remove the tags if they exist. The tags maybe have been normalized
+ # (e.g. turning .dev into .dev0) so we can't just compare strings
+ base_version = parse_version(version).base_version
+
+ # Add the tags
+ return base_version + self.vtags
def tags(self):
version = ''