未验证 提交 87d2b556 编写于 作者: R Roman Donchenko 提交者: GitHub

Don't hide the patch version number when it's 0 (#6687)

IMO, two-component version numbers should only be used when a project
doesn't make patch releases at all. Having two version components for
some releases and three for others is just pointless inconsistency.

Two-component version numbers are also inconsistent with our tag names.
上级 8f635fc9
openapi: 3.0.3 openapi: 3.0.3
info: info:
title: CVAT REST API title: CVAT REST API
version: '2.7' version: 2.7.0
description: REST API for Computer Vision Annotation Tool (CVAT) description: REST API for Computer Vision Annotation Tool (CVAT)
termsOfService: https://www.google.com/policies/terms/ termsOfService: https://www.google.com/policies/terms/
contact: contact:
......
...@@ -14,7 +14,7 @@ import subprocess ...@@ -14,7 +14,7 @@ import subprocess
def get_version(version): def get_version(version):
"""Return a PEP 440-compliant version number from VERSION.""" """Return a PEP 440-compliant version number from VERSION."""
# Now build the two parts of the version number: # Now build the two parts of the version number:
# main = X.Y[.Z] # main = X.Y.Z
# sub = .devN - for pre-alpha releases # sub = .devN - for pre-alpha releases
# | {a|b|rc}N - for alpha, beta, and rc releases # | {a|b|rc}N - for alpha, beta, and rc releases
...@@ -33,9 +33,8 @@ def get_version(version): ...@@ -33,9 +33,8 @@ def get_version(version):
return main + sub return main + sub
def get_main_version(version): def get_main_version(version):
"""Return main version (X.Y[.Z]) from VERSION.""" """Return main version (X.Y.Z) from VERSION."""
parts = 2 if version[2] == 0 else 3 return '.'.join(str(x) for x in version[:3])
return '.'.join(str(x) for x in version[:parts])
def get_git_changeset(): def get_git_changeset():
"""Return a numeric identifier of the latest git changeset. """Return a numeric identifier of the latest git changeset.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册