未验证 提交 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
info:
title: CVAT REST API
version: '2.7'
version: 2.7.0
description: REST API for Computer Vision Annotation Tool (CVAT)
termsOfService: https://www.google.com/policies/terms/
contact:
......
......@@ -14,7 +14,7 @@ import subprocess
def get_version(version):
"""Return a PEP 440-compliant version number from VERSION."""
# Now build the two parts of the version number:
# main = X.Y[.Z]
# main = X.Y.Z
# sub = .devN - for pre-alpha releases
# | {a|b|rc}N - for alpha, beta, and rc releases
......@@ -33,9 +33,8 @@ def get_version(version):
return main + sub
def get_main_version(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[:parts])
"""Return main version (X.Y.Z) from VERSION."""
return '.'.join(str(x) for x in version[:3])
def get_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.
先完成此消息的编辑!
想要评论请 注册