1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed #25769 -- Updated get_version() release candidate naming for PEP 0440.

This commit is contained in:
Tim Graham 2015-11-17 11:51:26 -05:00
parent fa08d27fb7
commit 4921d4e59f
3 changed files with 7 additions and 4 deletions

View File

@ -14,7 +14,7 @@ def get_version(version=None):
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases
# | {a|b|c}N - for alpha, beta and rc releases
# | {a|b|rc}N - for alpha, beta, and rc releases
main = get_main_version(version)
@ -25,7 +25,7 @@ def get_version(version=None):
sub = '.dev%s' % git_changeset
elif version[3] != 'final':
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'rc'}
sub = mapping[version[3]] + str(version[4])
return str(main + sub)

View File

@ -312,6 +312,9 @@ Miscellaneous
* Support for SpatiaLite < 3.0 and GEOS < 3.3 is dropped.
* ``utils.version.get_version()`` returns :pep:`440` compliant release
candidate versions (e.g. '1.10rc1' instead of '1.10c1').
.. _deprecated-features-1.10:
Features deprecated in 1.10

View File

@ -17,9 +17,9 @@ class VersionTests(TestCase):
tuples_to_strings = (
((1, 4, 0, 'alpha', 1), '1.4a1'),
((1, 4, 0, 'beta', 1), '1.4b1'),
((1, 4, 0, 'rc', 1), '1.4c1'),
((1, 4, 0, 'rc', 1), '1.4rc1'),
((1, 4, 0, 'final', 0), '1.4'),
((1, 4, 1, 'rc', 2), '1.4.1c2'),
((1, 4, 1, 'rc', 2), '1.4.1rc2'),
((1, 4, 1, 'final', 0), '1.4.1'),
)
for ver_tuple, ver_string in tuples_to_strings: