METADATA 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. Metadata-Version: 2.1
  2. Name: semver
  3. Version: 3.0.1
  4. Summary: Python helper for Semantic Versioning (https://semver.org)
  5. Home-page: https://github.com/python-semver/python-semver
  6. Author: Kostiantyn Rybnikov
  7. Author-email: k-bx@k-bx.com
  8. Maintainer: Sebastien Celles, Tom Schraitle
  9. Maintainer-email: s.celles@gmail.com
  10. License: BSD
  11. Project-URL: Changelog, https://python-semver.readthedocs.io/en/latest/changelog.html
  12. Project-URL: Documentation, https://python-semver.rtfd.io
  13. Project-URL: Releases, https://github.com/python-semver/python-semver/releases
  14. Project-URL: Bug Tracker, https://github.com/python-semver/python-semver/issues
  15. Classifier: Environment :: Web Environment
  16. Classifier: Intended Audience :: Developers
  17. Classifier: License :: OSI Approved :: BSD License
  18. Classifier: Operating System :: OS Independent
  19. Classifier: Programming Language :: Python
  20. Classifier: Programming Language :: Python :: 3
  21. Classifier: Programming Language :: Python :: 3.7
  22. Classifier: Programming Language :: Python :: 3.8
  23. Classifier: Programming Language :: Python :: 3.9
  24. Classifier: Programming Language :: Python :: 3.10
  25. Classifier: Programming Language :: Python :: 3.11
  26. Classifier: Programming Language :: Python :: 3.12
  27. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  28. Requires-Python: >=3.7
  29. Description-Content-Type: text/x-rst
  30. License-File: LICENSE.txt
  31. Quickstart
  32. ==========
  33. .. teaser-begin
  34. A Python module for `semantic versioning`_. Simplifies comparing versions.
  35. |GHAction| |python-support| |downloads| |license| |docs| |black|
  36. |openissues| |GHDiscussion|
  37. .. teaser-end
  38. .. note::
  39. This project works for Python 3.7 and greater only. If you are
  40. looking for a compatible version for Python 2, use the
  41. maintenance branch |MAINT|_.
  42. The last version of semver which supports Python 2.7 to 3.5 will be
  43. 2.x.y However, keep in mind, the major 2 release is frozen: no new
  44. features nor backports will be integrated.
  45. We recommend to upgrade your workflow to Python 3 to gain support,
  46. bugfixes, and new features.
  47. .. |MAINT| replace:: ``maint/v2``
  48. .. _MAINT: https://github.com/python-semver/python-semver/tree/maint/v2
  49. The module follows the ``MAJOR.MINOR.PATCH`` style:
  50. * ``MAJOR`` version when you make incompatible API changes,
  51. * ``MINOR`` version when you add functionality in a backwards compatible manner, and
  52. * ``PATCH`` version when you make backwards compatible bug fixes.
  53. Additional labels for pre-release and build metadata are supported.
  54. To import this library, use:
  55. .. code-block:: python
  56. >>> import semver
  57. Working with the library is quite straightforward. To turn a version string into the
  58. different parts, use the ``semver.Version.parse`` function:
  59. .. code-block:: python
  60. >>> ver = semver.Version.parse('1.2.3-pre.2+build.4')
  61. >>> ver.major
  62. 1
  63. >>> ver.minor
  64. 2
  65. >>> ver.patch
  66. 3
  67. >>> ver.prerelease
  68. 'pre.2'
  69. >>> ver.build
  70. 'build.4'
  71. To raise parts of a version, there are a couple of functions available for
  72. you. The function ``semver.Version.bump_major`` leaves the original object untouched, but
  73. returns a new ``semver.Version`` instance with the raised major part:
  74. .. code-block:: python
  75. >>> ver = semver.Version.parse("3.4.5")
  76. >>> ver.bump_major()
  77. Version(major=4, minor=0, patch=0, prerelease=None, build=None)
  78. It is allowed to concatenate different "bump functions":
  79. .. code-block:: python
  80. >>> ver.bump_major().bump_minor()
  81. Version(major=4, minor=1, patch=0, prerelease=None, build=None)
  82. To compare two versions, semver provides the ``semver.compare`` function.
  83. The return value indicates the relationship between the first and second
  84. version:
  85. .. code-block:: python
  86. >>> semver.compare("1.0.0", "2.0.0")
  87. -1
  88. >>> semver.compare("2.0.0", "1.0.0")
  89. 1
  90. >>> semver.compare("2.0.0", "2.0.0")
  91. 0
  92. There are other functions to discover. Read on!
  93. .. |latest-version| image:: https://img.shields.io/pypi/v/semver.svg
  94. :alt: Latest version on PyPI
  95. :target: https://pypi.org/project/semver
  96. .. |python-support| image:: https://img.shields.io/pypi/pyversions/semver.svg
  97. :target: https://pypi.org/project/semver
  98. :alt: Python versions
  99. .. |downloads| image:: https://img.shields.io/pypi/dm/semver.svg
  100. :alt: Monthly downloads from PyPI
  101. :target: https://pypi.org/project/semver
  102. .. |license| image:: https://img.shields.io/pypi/l/semver.svg
  103. :alt: Software license
  104. :target: https://github.com/python-semver/python-semver/blob/master/LICENSE.txt
  105. .. |docs| image:: https://readthedocs.org/projects/python-semver/badge/?version=latest
  106. :target: http://python-semver.readthedocs.io/en/latest/?badge=latest
  107. :alt: Documentation Status
  108. .. _semantic versioning: https://semver.org/
  109. .. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
  110. :target: https://github.com/psf/black
  111. :alt: Black Formatter
  112. .. |Gitter| image:: https://badges.gitter.im/python-semver/community.svg
  113. :target: https://gitter.im/python-semver/community
  114. :alt: Gitter
  115. .. |openissues| image:: http://isitmaintained.com/badge/open/python-semver/python-semver.svg
  116. :target: http://isitmaintained.com/project/python-semver/python-semver
  117. :alt: Percentage of open issues
  118. .. |GHAction| image:: https://github.com/python-semver/python-semver/workflows/Python/badge.svg
  119. :alt: Python
  120. .. |GHDiscussion| image:: https://shields.io/badge/GitHub-%20Discussions-green?logo=github
  121. :target: https://github.com/python-semver/python-semver/discussions
  122. :alt: GitHub Discussion