@@ -307,8 +307,12 @@ def parse(version):
307
307
return parse_version_info (version )
308
308
309
309
def replace (self , ** parts ):
310
- """Replace one or more parts of a version and return a new
311
- :class:`semver.VersionInfo` object, but leave self untouched
310
+ """
311
+ Replace one or more parts of a version and return a new
312
+ :class:`semver.VersionInfo` object, but leave self untouched
313
+
314
+ .. versionadded:: 2.9.0
315
+ Added :func:`VersionInfo.replace`
312
316
313
317
:param dict parts: the parts to be updated. Valid keys are:
314
318
``major``, ``minor``, ``patch``, ``prerelease``, or ``build``
@@ -333,6 +337,8 @@ def isvalid(cls, version):
333
337
"""
334
338
Check if the string is a valid semver version.
335
339
340
+ .. versionadded:: 2.9.1
341
+
336
342
:param str version: the version string to check
337
343
:return: True if the version string is a valid semver version, False
338
344
otherwise.
@@ -357,6 +363,9 @@ def parse_version_info(version):
357
363
"""
358
364
Parse version string to a VersionInfo instance.
359
365
366
+ .. versionadded:: 2.7.2
367
+ Added :func:`parse_version_info`
368
+
360
369
:param version: version string
361
370
:return: a :class:`VersionInfo` instance
362
371
:rtype: :class:`VersionInfo`
@@ -433,7 +442,7 @@ def _compare_by_keys(d1, d2):
433
442
434
443
def compare (ver1 , ver2 ):
435
444
"""
436
- Compare two versions.
445
+ Compare two versions strings .
437
446
438
447
:param ver1: version string 1
439
448
:param ver2: version string 2
@@ -456,7 +465,7 @@ def compare(ver1, ver2):
456
465
457
466
def match (version , match_expr ):
458
467
"""
459
- Compare two versions through a comparison.
468
+ Compare two versions strings through a comparison.
460
469
461
470
:param str version: a version string
462
471
:param str match_expr: operator and version; valid operators are
@@ -505,7 +514,7 @@ def match(version, match_expr):
505
514
506
515
def max_ver (ver1 , ver2 ):
507
516
"""
508
- Returns the greater version of two versions.
517
+ Returns the greater version of two versions strings .
509
518
510
519
:param ver1: version string 1
511
520
:param ver2: version string 2
@@ -524,7 +533,7 @@ def max_ver(ver1, ver2):
524
533
525
534
def min_ver (ver1 , ver2 ):
526
535
"""
527
- Returns the smaller version of two versions.
536
+ Returns the smaller version of two versions strings .
528
537
529
538
:param ver1: version string 1
530
539
:param ver2: version string 2
@@ -543,7 +552,7 @@ def min_ver(ver1, ver2):
543
552
544
553
def format_version (major , minor , patch , prerelease = None , build = None ):
545
554
"""
546
- Format a version according to the Semantic Versioning specification.
555
+ Format a version string according to the Semantic Versioning specification.
547
556
548
557
:param int major: the required major part of a version
549
558
:param int minor: the required minor part of a version
@@ -582,7 +591,7 @@ def _increment_string(string):
582
591
583
592
def bump_major (version ):
584
593
"""
585
- Raise the major part of the version.
594
+ Raise the major part of the version string .
586
595
587
596
:param: version string
588
597
:return: the raised version string
@@ -597,7 +606,7 @@ def bump_major(version):
597
606
598
607
def bump_minor (version ):
599
608
"""
600
- Raise the minor part of the version.
609
+ Raise the minor part of the version string .
601
610
602
611
:param: version string
603
612
:return: the raised version string
@@ -612,7 +621,7 @@ def bump_minor(version):
612
621
613
622
def bump_patch (version ):
614
623
"""
615
- Raise the patch part of the version.
624
+ Raise the patch part of the version string .
616
625
617
626
:param: version string
618
627
:return: the raised version string
@@ -627,7 +636,7 @@ def bump_patch(version):
627
636
628
637
def bump_prerelease (version , token = "rc" ):
629
638
"""
630
- Raise the prerelease part of the version.
639
+ Raise the prerelease part of the version string .
631
640
632
641
:param version: version string
633
642
:param token: defaults to 'rc'
@@ -648,7 +657,7 @@ def bump_prerelease(version, token="rc"):
648
657
649
658
def bump_build (version , token = "build" ):
650
659
"""
651
- Raise the build part of the version.
660
+ Raise the build part of the version string .
652
661
653
662
:param version: version string
654
663
:param token: defaults to 'build'
@@ -671,7 +680,10 @@ def bump_build(version, token="build"):
671
680
672
681
def finalize_version (version ):
673
682
"""
674
- Remove any prerelease and build metadata from the version.
683
+ Remove any prerelease and build metadata from the version string.
684
+
685
+ .. versionadded:: 2.7.9
686
+ Added :func:`finalize_version`
675
687
676
688
:param version: version string
677
689
:return: the finalized version string
@@ -830,6 +842,9 @@ def replace(version, **parts):
830
842
"""
831
843
Replace one or more parts of a version and return the new string.
832
844
845
+ .. versionadded:: 2.9.0
846
+ Added :func:`replace`
847
+
833
848
:param str version: the version string to replace
834
849
:param dict parts: the parts to be updated. Valid keys are:
835
850
``major``, ``minor``, ``patch``, ``prerelease``, or ``build``
0 commit comments