semver 3.0.2__tar.gz → 3.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. {semver-3.0.2 → semver-3.0.3}/CHANGELOG.rst +86 -1
  2. {semver-3.0.2 → semver-3.0.3}/LICENSE.txt +1 -1
  3. {semver-3.0.2 → semver-3.0.3}/PKG-INFO +36 -10
  4. semver-3.0.3/pyproject.toml +191 -0
  5. semver-3.0.3/setup.cfg +17 -0
  6. {semver-3.0.2 → semver-3.0.3}/src/semver/__about__.py +1 -1
  7. {semver-3.0.2 → semver-3.0.3}/src/semver/__main__.py +1 -0
  8. {semver-3.0.2 → semver-3.0.3}/src/semver/_deprecated.py +1 -0
  9. {semver-3.0.2 → semver-3.0.3}/src/semver/version.py +12 -14
  10. {semver-3.0.2 → semver-3.0.3}/src/semver.egg-info/PKG-INFO +36 -10
  11. semver-3.0.3/src/semver.egg-info/SOURCES.txt +35 -0
  12. {semver-3.0.2 → semver-3.0.3}/tests/test_semver.py +1 -2
  13. {semver-3.0.2 → semver-3.0.3}/tests/test_subclass.py +18 -0
  14. semver-3.0.2/.coveragerc +0 -13
  15. semver-3.0.2/.editorconfig +0 -15
  16. semver-3.0.2/.gitignore +0 -273
  17. semver-3.0.2/.readthedocs.yaml +0 -20
  18. semver-3.0.2/CITATION.cff +0 -104
  19. semver-3.0.2/CONTRIBUTORS +0 -62
  20. semver-3.0.2/Makefile +0 -5
  21. semver-3.0.2/SUPPORT.md +0 -14
  22. semver-3.0.2/changelog.d/.gitignore +0 -1
  23. semver-3.0.2/changelog.d/README.rst +0 -76
  24. semver-3.0.2/changelog.d/_template.rst +0 -42
  25. semver-3.0.2/docs/Makefile +0 -20
  26. semver-3.0.2/docs/_static/css/custom.css +0 -83
  27. semver-3.0.2/docs/_static/logo.svg +0 -204
  28. semver-3.0.2/docs/_templates/layout.html +0 -49
  29. semver-3.0.2/docs/advanced/coerce.py +0 -44
  30. semver-3.0.2/docs/advanced/combine-pydantic-and-semver.rst +0 -79
  31. semver-3.0.2/docs/advanced/convert-pypi-to-semver.rst +0 -207
  32. semver-3.0.2/docs/advanced/create-subclasses-from-version.rst +0 -34
  33. semver-3.0.2/docs/advanced/deal-with-invalid-versions.rst +0 -32
  34. semver-3.0.2/docs/advanced/display-deprecation-warnings.rst +0 -34
  35. semver-3.0.2/docs/advanced/index.rst +0 -13
  36. semver-3.0.2/docs/advanced/semverwithvprefix.py +0 -27
  37. semver-3.0.2/docs/advanced/version-from-file.rst +0 -24
  38. semver-3.0.2/docs/api.rst +0 -86
  39. semver-3.0.2/docs/build-semver.rst +0 -61
  40. semver-3.0.2/docs/changelog-semver3-devel.rst +0 -365
  41. semver-3.0.2/docs/changelog.rst +0 -3
  42. semver-3.0.2/docs/conf.py +0 -285
  43. semver-3.0.2/docs/contribute/add-changelog-entry.rst +0 -7
  44. semver-3.0.2/docs/contribute/doc-semver.rst +0 -86
  45. semver-3.0.2/docs/contribute/finish-release.rst +0 -24
  46. semver-3.0.2/docs/contribute/index.rst +0 -28
  47. semver-3.0.2/docs/contribute/prerequisites.rst +0 -15
  48. semver-3.0.2/docs/contribute/release-procedure.rst +0 -123
  49. semver-3.0.2/docs/contribute/report-bugs.rst +0 -18
  50. semver-3.0.2/docs/contribute/run-test-suite.rst +0 -64
  51. semver-3.0.2/docs/index.rst +0 -44
  52. semver-3.0.2/docs/install.rst +0 -119
  53. semver-3.0.2/docs/inventories/pydantic.inv +0 -0
  54. semver-3.0.2/docs/inventories/python-objects.inv +0 -0
  55. semver-3.0.2/docs/make.bat +0 -36
  56. semver-3.0.2/docs/migration/index.rst +0 -9
  57. semver-3.0.2/docs/migration/migratetosemver3.rst +0 -51
  58. semver-3.0.2/docs/migration/replace-deprecated-functions.rst +0 -136
  59. semver-3.0.2/docs/pysemver.rst +0 -173
  60. semver-3.0.2/docs/readme.rst +0 -4
  61. semver-3.0.2/docs/requirements.txt +0 -5
  62. semver-3.0.2/docs/usage/access-parts-of-a-version.rst +0 -43
  63. semver-3.0.2/docs/usage/access-parts-through-index.rst +0 -48
  64. semver-3.0.2/docs/usage/check-compatible-semver-version.rst +0 -95
  65. semver-3.0.2/docs/usage/check-valid-semver-version.rst +0 -12
  66. semver-3.0.2/docs/usage/compare-versions-through-expression.rst +0 -39
  67. semver-3.0.2/docs/usage/compare-versions.rst +0 -99
  68. semver-3.0.2/docs/usage/convert-version-into-different-types.rst +0 -26
  69. semver-3.0.2/docs/usage/create-a-version.rst +0 -100
  70. semver-3.0.2/docs/usage/determine-version-equality.rst +0 -25
  71. semver-3.0.2/docs/usage/get-min-and-max-of-multiple-versions.rst +0 -42
  72. semver-3.0.2/docs/usage/increase-parts-of-a-version_prereleases.rst +0 -24
  73. semver-3.0.2/docs/usage/index.rst +0 -21
  74. semver-3.0.2/docs/usage/parse-version-string.rst +0 -15
  75. semver-3.0.2/docs/usage/raise-parts-of-a-version.rst +0 -70
  76. semver-3.0.2/docs/usage/replace-parts-of-a-version.rst +0 -19
  77. semver-3.0.2/docs/usage/semver-version.rst +0 -7
  78. semver-3.0.2/docs/usage/semver_org-version.rst +0 -10
  79. semver-3.0.2/docs/version-policy.rst +0 -52
  80. semver-3.0.2/pyproject.toml +0 -73
  81. semver-3.0.2/release-procedure.md +0 -123
  82. semver-3.0.2/setup.cfg +0 -93
  83. semver-3.0.2/src/semver.egg-info/SOURCES.txt +0 -106
  84. semver-3.0.2/tests/coerce.py +0 -44
  85. semver-3.0.2/tests/conftest.py +0 -31
  86. semver-3.0.2/tests/semverwithvprefix.py +0 -27
  87. semver-3.0.2/tox.ini +0 -118
  88. {semver-3.0.2 → semver-3.0.3}/CONTRIBUTING.rst +0 -0
  89. {semver-3.0.2 → semver-3.0.3}/MANIFEST.in +0 -0
  90. {semver-3.0.2 → semver-3.0.3}/README.rst +0 -0
  91. {semver-3.0.2 → semver-3.0.3}/src/semver/__init__.py +0 -0
  92. {semver-3.0.2 → semver-3.0.3}/src/semver/_types.py +0 -0
  93. {semver-3.0.2 → semver-3.0.3}/src/semver/cli.py +0 -0
  94. {semver-3.0.2 → semver-3.0.3}/src/semver/py.typed +0 -0
  95. {semver-3.0.2 → semver-3.0.3}/src/semver.egg-info/dependency_links.txt +0 -0
  96. {semver-3.0.2 → semver-3.0.3}/src/semver.egg-info/entry_points.txt +0 -0
  97. {semver-3.0.2 → semver-3.0.3}/src/semver.egg-info/top_level.txt +0 -0
  98. {semver-3.0.2 → semver-3.0.3}/tests/test_bump.py +0 -0
  99. {semver-3.0.2 → semver-3.0.3}/tests/test_compare.py +0 -0
  100. {semver-3.0.2 → semver-3.0.3}/tests/test_deprecated_functions.py +0 -0
  101. {semver-3.0.2 → semver-3.0.3}/tests/test_docstrings.py +0 -0
  102. {semver-3.0.2 → semver-3.0.3}/tests/test_format.py +0 -0
  103. {semver-3.0.2 → semver-3.0.3}/tests/test_immutable.py +0 -0
  104. {semver-3.0.2 → semver-3.0.3}/tests/test_index.py +0 -0
  105. {semver-3.0.2 → semver-3.0.3}/tests/test_match.py +0 -0
  106. {semver-3.0.2 → semver-3.0.3}/tests/test_max-min.py +0 -0
  107. {semver-3.0.2 → semver-3.0.3}/tests/test_parsing.py +0 -0
  108. {semver-3.0.2 → semver-3.0.3}/tests/test_pysemver-cli.py +0 -0
  109. {semver-3.0.2 → semver-3.0.3}/tests/test_replace.py +0 -0
  110. {semver-3.0.2 → semver-3.0.3}/tests/test_typeerror-274.py +0 -0
@@ -18,11 +18,96 @@ This section covers the changes between major version 2 and version 3.
18
18
 
19
19
  .. towncrier release notes start
20
20
 
21
+ Version 3.0.3
22
+ =============
23
+
24
+ :Released: 2025-01-18
25
+ :Maintainer: Tom Schraitle
26
+
27
+
28
+ Bug Fixes
29
+ ---------
30
+
31
+ * :pr:`453`: The check in ``_comparator`` does not match the check in :meth:`Version.compare`.
32
+ This breaks comparision with subclasses.
33
+
34
+
35
+
36
+ Improved Documentation
37
+ ----------------------
38
+
39
+ * :pr:`435`: Several small improvements for documentation:
40
+
41
+ * Add meta description to improve SEO
42
+ * Use canonicals on ReadTheDocs (commit 87f639f)
43
+ * Pin versions for reproducable doc builds (commit 03fb990)
44
+ * Add missing :file:`.readthedocs.yaml` file (commit ec9348a)
45
+ * Correct some smaller issues when building (commit f65feab)
46
+
47
+ * :pr:`436`: Move search box more at the top. This makes it easier for
48
+ users as if the TOC is long, the search box isn't visible
49
+ anymore.
50
+
51
+
52
+
53
+ Features
54
+ --------
55
+
56
+ * :pr:`439`: Improve type hints to fix TODOs
57
+
58
+
59
+
60
+ Internal Changes
61
+ ----------------
62
+
63
+ * :pr:`440`: Update workflow file
64
+
65
+ * :pr:`446`: Add Python 3.13 to GitHub Actions
66
+
67
+ * :pr:`447`: Modernize project configs with :file:`pyproject.toml` and
68
+ use Astral's uv command.
69
+
70
+ * In :file:`pyproject.toml`:
71
+
72
+ * Move all project related data from :file:`setup.cfg` to :file:`pyproject.toml`
73
+ * Use new dependency group from :pep:`735`
74
+ * Consolidate flake8, isort, pycodestyle with ruff
75
+ * Split towncrier config type "trivial" into "trivial" and "internal"
76
+
77
+ * Create config file for ruff (:file:`.ruff.toml`)
78
+ * Create config file for pytest (:file:`.pytest.ini`)
79
+ * Simplify :file:`tox.ini` and remove old stuff
80
+ * Document installation with new :command:`uv` command
81
+ * Simplify Sphinx config with :func:`find_version()`
82
+ * Update the authors
83
+ * Use :command:`uv` in GitHub Action :file:`python-testing.yml` workflow
84
+
85
+ * Update :file:`release-procedure.md`.
86
+
87
+ * :pr:`451`: Turn our Markdown issue templates into YAML
88
+
89
+
90
+ Trivial Changes
91
+ ---------------
92
+
93
+ * :pr:`438`: Replace organization placeholder in license
94
+
95
+ * :pr:`445`: Improve private :func:`_nat_cmp` method:
96
+
97
+ * Remove obsolete else.
98
+ * Find a better way to identify digits without the :mod:`re` module.
99
+ * Fix docstring in :meth:`Version.compare`
100
+
101
+
102
+
103
+ ----
104
+
105
+
21
106
  Version 3.0.2
22
107
  =============
23
108
 
24
109
  :Released: 2023-10-09
25
- :Maintainer:
110
+ :Maintainer: Tom Schraitle
26
111
 
27
112
 
28
113
  Bug Fixes
@@ -11,7 +11,7 @@ are permitted provided that the following conditions are met:
11
11
  list of conditions and the following disclaimer in the documentation and/or
12
12
  other materials provided with the distribution.
13
13
 
14
- Neither the name of the {organization} nor the names of its
14
+ Neither the name of the python-semver org nor the names of its
15
15
  contributors may be used to endorse or promote products derived from
16
16
  this software without specific prior written permission.
17
17
 
@@ -1,22 +1,46 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: semver
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
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
5
+ Author-email: Kostiantyn Rybnikov <k-bx@k-bx.com>, Tom Schraitle <toms@suse.de>
6
+ Maintainer-email: Tom Schraitle <toms@suse.de>, Sebastien Celles <s.celles@gmail.com>
7
+ License: Copyright (c) 2013, Konstantine Rybnikov
8
+ All rights reserved.
9
+
10
+ Redistribution and use in source and binary forms, with or without modification,
11
+ are permitted provided that the following conditions are met:
12
+
13
+ Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+
16
+ Redistributions in binary form must reproduce the above copyright notice, this
17
+ list of conditions and the following disclaimer in the documentation and/or
18
+ other materials provided with the distribution.
19
+
20
+ Neither the name of the python-semver org nor the names of its
21
+ contributors may be used to endorse or promote products derived from
22
+ this software without specific prior written permission.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+ Project-URL: GitHub Homepage, https://github.com/python-semver/python-semver
11
36
  Project-URL: Changelog, https://python-semver.readthedocs.io/en/latest/changelog.html
12
37
  Project-URL: Documentation, https://python-semver.rtfd.io
13
38
  Project-URL: Releases, https://github.com/python-semver/python-semver/releases
14
39
  Project-URL: Bug Tracker, https://github.com/python-semver/python-semver/issues
15
40
  Classifier: Environment :: Web Environment
16
41
  Classifier: Intended Audience :: Developers
17
- Classifier: License :: OSI Approved :: BSD License
42
+ Classifier: Development Status :: 5 - Production/Stable
18
43
  Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python
20
44
  Classifier: Programming Language :: Python :: 3
21
45
  Classifier: Programming Language :: Python :: 3.7
22
46
  Classifier: Programming Language :: Python :: 3.8
@@ -24,6 +48,8 @@ Classifier: Programming Language :: Python :: 3.9
24
48
  Classifier: Programming Language :: Python :: 3.10
25
49
  Classifier: Programming Language :: Python :: 3.11
26
50
  Classifier: Programming Language :: Python :: 3.12
51
+ Classifier: Programming Language :: Python :: 3.13
52
+ Classifier: Programming Language :: Python :: 3.14
27
53
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
54
  Requires-Python: >=3.7
29
55
  Description-Content-Type: text/x-rst
@@ -0,0 +1,191 @@
1
+ #
2
+ #
3
+ # See also https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
4
+ #
5
+ # General idea taken from
6
+ # https://godatadriven.com/blog/a-practical-guide-to-setuptools-and-pyproject-toml/
7
+
8
+ [build-system]
9
+ requires = [
10
+ "setuptools>=61",
11
+ # "setuptools-scm>=8",
12
+ ]
13
+ build-backend = "setuptools.build_meta"
14
+
15
+
16
+ [project]
17
+ requires-python = ">=3.7"
18
+ name = "semver"
19
+ description = "Python helper for Semantic Versioning (https://semver.org)"
20
+ readme = "README.rst"
21
+ # PEP 639
22
+ # licence = "BSD-2-Clause"
23
+ # readme.content-type = "text/x-rst"
24
+ license = { file = "LICENSE.txt" }
25
+ authors = [
26
+ {name = "Kostiantyn Rybnikov", email = "k-bx@k-bx.com"},
27
+ {name = "Tom Schraitle", email = "toms@suse.de"},
28
+ ]
29
+ maintainers = [
30
+ {name = "Tom Schraitle", email = "toms@suse.de"},
31
+ {name = "Sebastien Celles", email = "s.celles@gmail.com"},
32
+ ]
33
+ dynamic = ["version",]
34
+ classifiers = [
35
+ "Environment :: Web Environment",
36
+ "Intended Audience :: Developers",
37
+ "Development Status :: 5 - Production/Stable",
38
+ # "License :: OSI Approved :: BSD License",
39
+ "Operating System :: OS Independent",
40
+ "Programming Language :: Python :: 3",
41
+ "Programming Language :: Python :: 3.7",
42
+ "Programming Language :: Python :: 3.8",
43
+ "Programming Language :: Python :: 3.9",
44
+ "Programming Language :: Python :: 3.10",
45
+ "Programming Language :: Python :: 3.11",
46
+ "Programming Language :: Python :: 3.12",
47
+ "Programming Language :: Python :: 3.13",
48
+ "Programming Language :: Python :: 3.14",
49
+ "Topic :: Software Development :: Libraries :: Python Modules",
50
+ ]
51
+
52
+
53
+ [project.urls]
54
+ "GitHub Homepage" = "https://github.com/python-semver/python-semver"
55
+ Changelog = "https://python-semver.readthedocs.io/en/latest/changelog.html"
56
+ Documentation = "https://python-semver.rtfd.io"
57
+ Releases = "https://github.com/python-semver/python-semver/releases"
58
+ "Bug Tracker" = "https://github.com/python-semver/python-semver/issues"
59
+
60
+
61
+ [project.scripts]
62
+ pysemver = "semver.cli:main"
63
+
64
+
65
+ [dependency-groups]
66
+ # See https://github.com/astral-sh/uv/issues/5632
67
+ # See https://peps.python.org/pep-0735/
68
+ typing = [
69
+ "mypy",
70
+ "pyright",
71
+ ]
72
+ formatting = [
73
+ "black",
74
+ "ruff",
75
+ "docformatter",
76
+ ]
77
+ test = [
78
+ "tox",
79
+ "pytest",
80
+ "pytest-cov",
81
+
82
+ ]
83
+ publish = [
84
+ "twine",
85
+ # pyproject-build is required for building the package
86
+ "build",
87
+ ]
88
+ changelog = [
89
+ "towncrier",
90
+ ]
91
+ docs = [
92
+ # Required in .readthedocs.yaml
93
+ "sphinx", # ==7.0.1
94
+ "sphinx-argparse", # ==0.4.0
95
+ "sphinx-autodoc-typehints", # ==1.24.0
96
+ "restview",
97
+ ]
98
+ devel = [
99
+ {include-group = "typing"},
100
+ {include-group = "formatting"},
101
+ {include-group = "test"},
102
+ {include-group = "changelog"},
103
+ {include-group = "docs"},
104
+ {include-group = "publish"},
105
+ ]
106
+ # Only needed when using GitHub Actions
107
+ gh-action = [
108
+ {include-group = "devel"},
109
+ "tox-gh-actions",
110
+ ]
111
+
112
+ # --- Setuptools configuration ---
113
+ [tool.setuptools]
114
+ package-dir = {"" = "src"}
115
+ package-data = { "semver" = ["py.typed"] }
116
+ include-package-data = true
117
+
118
+
119
+ [tool.setuptools.packages.find]
120
+ # Is that still necessary?
121
+ # list of folders that contain the packages (["."] by default)
122
+ where = ["src"]
123
+
124
+
125
+ [tool.setuptools.dynamic]
126
+ version = {attr = "semver.__about__.__version__"}
127
+
128
+
129
+ # ---------------------------------
130
+ [tool.setuptools_scm]
131
+ version_scheme = "post-release"
132
+ local_scheme = "dirty-tag"
133
+
134
+
135
+ [tool.mypy]
136
+ # ignore_missing_imports = true
137
+ check_untyped_defs = true
138
+ show_error_codes = true
139
+ # strict = true
140
+ pretty = true
141
+
142
+
143
+ [tool.black]
144
+ line-length = 88
145
+ target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
146
+ # diff = true
147
+
148
+
149
+ [tool.docformatter]
150
+ wrap-summaries = 80
151
+ close-quotes-on-newline = true
152
+ # make-summary-multi-line = true
153
+ black = true
154
+ pre-summary-newline = true
155
+ recursive = true
156
+
157
+
158
+ [tool.towncrier]
159
+ package = "semver"
160
+ package_dir = "src"
161
+ filename = "CHANGELOG.rst"
162
+ directory = "changelog.d/"
163
+ title_format = "Version {version}"
164
+ template = "changelog.d/_template.rst"
165
+ # issue_format = "`#{issue} <https://github.com/python-attrs/attrs/issues/{issue}>`_"
166
+ # issue_format = ":gh:`{issue}`"
167
+
168
+
169
+ [tool.towncrier.fragment.breaking]
170
+ name = "Breaking Changes"
171
+
172
+ [tool.towncrier.fragment.bugfix]
173
+ name = "Bug Fixes"
174
+
175
+ [tool.towncrier.fragment.deprecation]
176
+ name = "Deprecations"
177
+
178
+ [tool.towncrier.fragment.doc]
179
+ name = "Improved Documentation"
180
+
181
+ [tool.towncrier.fragment.feature]
182
+ name = "Features"
183
+
184
+ [tool.towncrier.fragment.removal]
185
+ name = "Removals"
186
+
187
+ [tool.towncrier.fragment.trivial]
188
+ name = "Trivial Changes"
189
+
190
+ [tool.towncrier.fragment.internal]
191
+ name = "Internal Changes"
semver-3.0.3/setup.cfg ADDED
@@ -0,0 +1,17 @@
1
+ [pycodestyle]
2
+ count = False
3
+ ignore = E203,E701
4
+ max-line-length = 88
5
+ statistics = True
6
+ exclude =
7
+ src/semver/__init__.py
8
+ .env,
9
+ .eggs,
10
+ .tox,
11
+ .git,
12
+ docs
13
+
14
+ [egg_info]
15
+ tag_build =
16
+ tag_date = 0
17
+
@@ -16,7 +16,7 @@ of the semver specifictation, author, maintainers, and description.
16
16
  """
17
17
 
18
18
  #: Semver version
19
- __version__ = "3.0.2"
19
+ __version__ = "3.0.3"
20
20
 
21
21
  #: Original semver author
22
22
  __author__ = "Kostiantyn Rybnikov"
@@ -9,6 +9,7 @@ This makes it also possible to "run" a wheel like in this command::
9
9
  $ python3 semver-3*-py3-none-any.whl/semver -h
10
10
 
11
11
  """
12
+
12
13
  import os.path
13
14
  import sys
14
15
  from typing import List, Optional
@@ -3,6 +3,7 @@ Contains all deprecated functions.
3
3
 
4
4
  .. autofunction: deprecated
5
5
  """
6
+
6
7
  import inspect
7
8
  import warnings
8
9
  from functools import partial, wraps
@@ -32,6 +32,7 @@ Comparable = Union["Version", Dict[str, VersionPart], Collection[VersionPart], s
32
32
  Comparator = Callable[["Version", Comparable], bool]
33
33
 
34
34
  T = TypeVar("T", bound="Version")
35
+ T_cmp = TypeVar("T_cmp", tuple, str, int)
35
36
 
36
37
 
37
38
  def _comparator(operator: Comparator) -> Comparator:
@@ -40,7 +41,7 @@ def _comparator(operator: Comparator) -> Comparator:
40
41
  @wraps(operator)
41
42
  def wrapper(self: "Version", other: Comparable) -> bool:
42
43
  comparable_types = (
43
- Version,
44
+ type(self),
44
45
  dict,
45
46
  tuple,
46
47
  list,
@@ -53,7 +54,7 @@ def _comparator(operator: Comparator) -> Comparator:
53
54
  return wrapper
54
55
 
55
56
 
56
- def _cmp(a, b): # TODO: type hints
57
+ def _cmp(a: T_cmp, b: T_cmp) -> int:
57
58
  """Return negative if a<b, zero if a==b, positive if a>b."""
58
59
  return (a > b) - (a < b)
59
60
 
@@ -137,7 +138,7 @@ class Version:
137
138
  self._build = None if build is None else str(build)
138
139
 
139
140
  @classmethod
140
- def _nat_cmp(cls, a, b): # TODO: type hints
141
+ def _nat_cmp(cls, a: Optional[str], b: Optional[str]) -> int:
141
142
  def cmp_prerelease_tag(a, b):
142
143
  if isinstance(a, int) and isinstance(b, int):
143
144
  return _cmp(a, b)
@@ -148,16 +149,15 @@ class Version:
148
149
  else:
149
150
  return _cmp(a, b)
150
151
 
151
- a, b = a or "", b or ""
152
- a_parts, b_parts = a.split("."), b.split(".")
153
- a_parts = [int(x) if re.match(r"^\d+$", x) else x for x in a_parts]
154
- b_parts = [int(x) if re.match(r"^\d+$", x) else x for x in b_parts]
152
+ a_parts = [int(x) if x.isdigit() else x for x in (a or "").split(".")]
153
+ b_parts = [int(x) if x.isdigit() else x for x in (b or "").split(".")]
154
+
155
155
  for sub_a, sub_b in zip(a_parts, b_parts):
156
156
  cmp_result = cmp_prerelease_tag(sub_a, sub_b)
157
157
  if cmp_result != 0:
158
158
  return cmp_result
159
- else:
160
- return _cmp(len(a), len(b))
159
+
160
+ return _cmp(len(a_parts), len(b_parts))
161
161
 
162
162
  @property
163
163
  def major(self) -> int:
@@ -382,13 +382,11 @@ build='build.10')
382
382
  :return: The return value is negative if ver1 < ver2,
383
383
  zero if ver1 == ver2 and strictly positive if ver1 > ver2
384
384
 
385
- >>> semver.compare("2.0.0")
385
+ >>> Version.parse("1.0.0").compare("2.0.0")
386
386
  -1
387
- >>> semver.compare("1.0.0")
387
+ >>> Version.parse("2.0.0").compare("1.0.0")
388
388
  1
389
- >>> semver.compare("2.0.0")
390
- 0
391
- >>> semver.compare(dict(major=2, minor=0, patch=0))
389
+ >>> Version.parse("2.0.0").compare("2.0.0")
392
390
  0
393
391
  """
394
392
  cls = type(self)
@@ -1,22 +1,46 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: semver
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
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
5
+ Author-email: Kostiantyn Rybnikov <k-bx@k-bx.com>, Tom Schraitle <toms@suse.de>
6
+ Maintainer-email: Tom Schraitle <toms@suse.de>, Sebastien Celles <s.celles@gmail.com>
7
+ License: Copyright (c) 2013, Konstantine Rybnikov
8
+ All rights reserved.
9
+
10
+ Redistribution and use in source and binary forms, with or without modification,
11
+ are permitted provided that the following conditions are met:
12
+
13
+ Redistributions of source code must retain the above copyright notice, this
14
+ list of conditions and the following disclaimer.
15
+
16
+ Redistributions in binary form must reproduce the above copyright notice, this
17
+ list of conditions and the following disclaimer in the documentation and/or
18
+ other materials provided with the distribution.
19
+
20
+ Neither the name of the python-semver org nor the names of its
21
+ contributors may be used to endorse or promote products derived from
22
+ this software without specific prior written permission.
23
+
24
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+
35
+ Project-URL: GitHub Homepage, https://github.com/python-semver/python-semver
11
36
  Project-URL: Changelog, https://python-semver.readthedocs.io/en/latest/changelog.html
12
37
  Project-URL: Documentation, https://python-semver.rtfd.io
13
38
  Project-URL: Releases, https://github.com/python-semver/python-semver/releases
14
39
  Project-URL: Bug Tracker, https://github.com/python-semver/python-semver/issues
15
40
  Classifier: Environment :: Web Environment
16
41
  Classifier: Intended Audience :: Developers
17
- Classifier: License :: OSI Approved :: BSD License
42
+ Classifier: Development Status :: 5 - Production/Stable
18
43
  Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python
20
44
  Classifier: Programming Language :: Python :: 3
21
45
  Classifier: Programming Language :: Python :: 3.7
22
46
  Classifier: Programming Language :: Python :: 3.8
@@ -24,6 +48,8 @@ Classifier: Programming Language :: Python :: 3.9
24
48
  Classifier: Programming Language :: Python :: 3.10
25
49
  Classifier: Programming Language :: Python :: 3.11
26
50
  Classifier: Programming Language :: Python :: 3.12
51
+ Classifier: Programming Language :: Python :: 3.13
52
+ Classifier: Programming Language :: Python :: 3.14
27
53
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
54
  Requires-Python: >=3.7
29
55
  Description-Content-Type: text/x-rst
@@ -0,0 +1,35 @@
1
+ CHANGELOG.rst
2
+ CONTRIBUTING.rst
3
+ LICENSE.txt
4
+ MANIFEST.in
5
+ README.rst
6
+ pyproject.toml
7
+ setup.cfg
8
+ src/semver/__about__.py
9
+ src/semver/__init__.py
10
+ src/semver/__main__.py
11
+ src/semver/_deprecated.py
12
+ src/semver/_types.py
13
+ src/semver/cli.py
14
+ src/semver/py.typed
15
+ src/semver/version.py
16
+ src/semver.egg-info/PKG-INFO
17
+ src/semver.egg-info/SOURCES.txt
18
+ src/semver.egg-info/dependency_links.txt
19
+ src/semver.egg-info/entry_points.txt
20
+ src/semver.egg-info/top_level.txt
21
+ tests/test_bump.py
22
+ tests/test_compare.py
23
+ tests/test_deprecated_functions.py
24
+ tests/test_docstrings.py
25
+ tests/test_format.py
26
+ tests/test_immutable.py
27
+ tests/test_index.py
28
+ tests/test_match.py
29
+ tests/test_max-min.py
30
+ tests/test_parsing.py
31
+ tests/test_pysemver-cli.py
32
+ tests/test_replace.py
33
+ tests/test_semver.py
34
+ tests/test_subclass.py
35
+ tests/test_typeerror-274.py
@@ -131,7 +131,6 @@ def test_should_fail_with_incompatible_type_for_compatible_match(wrongtype):
131
131
 
132
132
 
133
133
  def test_should_succeed_with_compatible_subclass_for_is_compatible():
134
- class CustomVersion(Version):
135
- ...
134
+ class CustomVersion(Version): ...
136
135
 
137
136
  assert CustomVersion(1, 0, 0).is_compatible(Version(1, 0, 0))
@@ -1,4 +1,5 @@
1
1
  from semver import Version
2
+ import pytest
2
3
 
3
4
 
4
5
  def test_subclass_from_versioninfo():
@@ -51,3 +52,20 @@ def test_replace_from_subclass():
51
52
  dev_version = version.replace(prerelease="dev.0")
52
53
 
53
54
  assert str(dev_version) == "v1.1.0-dev.0"
55
+
56
+
57
+ def test_compare_with_subclass():
58
+ class SemVerSubclass(Version):
59
+ pass
60
+
61
+ with pytest.raises(TypeError):
62
+ SemVerSubclass.parse("1.0.0").compare(Version.parse("1.0.0"))
63
+ assert Version.parse("1.0.0").compare(SemVerSubclass.parse("1.0.0")) == 0
64
+
65
+ assert (
66
+ SemVerSubclass.parse("1.0.0").__eq__(Version.parse("1.0.0")) is NotImplemented
67
+ )
68
+ assert Version.parse("1.0.0").__eq__(SemVerSubclass.parse("1.0.0")) is True
69
+
70
+ assert SemVerSubclass.parse("1.0.0") == Version.parse("1.0.0")
71
+ assert Version.parse("1.0.0") == SemVerSubclass.parse("1.0.0")
semver-3.0.2/.coveragerc DELETED
@@ -1,13 +0,0 @@
1
- # https://pytest-cov.readthedocs.io/
2
-
3
- [run]
4
- source = semver
5
- branch = True
6
-
7
- [report]
8
- show_missing = true
9
- precision = 1
10
- exclude_lines =
11
- pragma: no cover
12
- if __name__ == .__main__.:
13
- if not hasattr\(__builtins__, .cmp.\):
@@ -1,15 +0,0 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- end_of_line = lf
6
- charset = utf-8
7
-
8
- [*.py]
9
- indent_style = space
10
- indent_size = 4
11
- trim_trailing_whitespace = true
12
- insert_final_newline = true
13
-
14
- [docs/Makefile]
15
- indent_style = tab