semver 3.0.2__tar.gz → 3.0.4__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 (118) hide show
  1. {semver-3.0.2 → semver-3.0.4}/.editorconfig +1 -0
  2. {semver-3.0.2 → semver-3.0.4}/.gitignore +1 -1
  3. semver-3.0.4/.pytest.ini +15 -0
  4. {semver-3.0.2 → semver-3.0.4}/.readthedocs.yaml +9 -3
  5. semver-3.0.4/.ruff.toml +53 -0
  6. {semver-3.0.2 → semver-3.0.4}/CHANGELOG.rst +105 -1
  7. {semver-3.0.2 → semver-3.0.4}/LICENSE.txt +1 -1
  8. semver-3.0.4/MANIFEST.in +26 -0
  9. {semver-3.0.2 → semver-3.0.4}/PKG-INFO +36 -9
  10. semver-3.0.4/changelog.d/459.bugfix.rst +4 -0
  11. {semver-3.0.2 → semver-3.0.4}/docs/Makefile +6 -0
  12. {semver-3.0.2 → semver-3.0.4}/docs/_static/css/custom.css +4 -0
  13. semver-3.0.4/docs/_templates/layout.html +10 -0
  14. {semver-3.0.2 → semver-3.0.4}/docs/advanced/combine-pydantic-and-semver.rst +4 -0
  15. {semver-3.0.2 → semver-3.0.4}/docs/advanced/convert-pypi-to-semver.rst +5 -1
  16. {semver-3.0.2 → semver-3.0.4}/docs/advanced/create-subclasses-from-version.rst +4 -0
  17. {semver-3.0.2 → semver-3.0.4}/docs/advanced/deal-with-invalid-versions.rst +4 -0
  18. {semver-3.0.2 → semver-3.0.4}/docs/advanced/display-deprecation-warnings.rst +4 -0
  19. {semver-3.0.2 → semver-3.0.4}/docs/advanced/index.rst +3 -0
  20. {semver-3.0.2 → semver-3.0.4}/docs/advanced/version-from-file.rst +5 -1
  21. {semver-3.0.2 → semver-3.0.4}/docs/api.rst +4 -0
  22. semver-3.0.4/docs/build-semver.rst +33 -0
  23. {semver-3.0.2 → semver-3.0.4}/docs/conf.py +30 -23
  24. {semver-3.0.2 → semver-3.0.4}/docs/contribute/add-changelog-entry.rst +4 -0
  25. {semver-3.0.2 → semver-3.0.4}/docs/contribute/doc-semver.rst +4 -0
  26. {semver-3.0.2 → semver-3.0.4}/docs/contribute/finish-release.rst +4 -0
  27. {semver-3.0.2 → semver-3.0.4}/docs/contribute/index.rst +4 -0
  28. {semver-3.0.2 → semver-3.0.4}/docs/contribute/prerequisites.rst +4 -0
  29. {semver-3.0.2 → semver-3.0.4}/docs/contribute/release-procedure.rst +4 -0
  30. {semver-3.0.2 → semver-3.0.4}/docs/contribute/report-bugs.rst +4 -0
  31. {semver-3.0.2 → semver-3.0.4}/docs/contribute/run-test-suite.rst +4 -0
  32. {semver-3.0.2 → semver-3.0.4}/docs/index.rst +4 -0
  33. {semver-3.0.2 → semver-3.0.4}/docs/install.rst +23 -3
  34. {semver-3.0.2 → semver-3.0.4}/docs/migration/index.rst +3 -0
  35. {semver-3.0.2 → semver-3.0.4}/docs/migration/migratetosemver3.rst +4 -0
  36. {semver-3.0.2 → semver-3.0.4}/docs/migration/replace-deprecated-functions.rst +4 -0
  37. {semver-3.0.2 → semver-3.0.4}/docs/pysemver.rst +4 -0
  38. semver-3.0.4/docs/requirements.txt +5 -0
  39. {semver-3.0.2 → semver-3.0.4}/docs/usage/access-parts-of-a-version.rst +4 -0
  40. {semver-3.0.2 → semver-3.0.4}/docs/usage/access-parts-through-index.rst +4 -0
  41. {semver-3.0.2 → semver-3.0.4}/docs/usage/check-compatible-semver-version.rst +4 -0
  42. {semver-3.0.2 → semver-3.0.4}/docs/usage/check-valid-semver-version.rst +4 -0
  43. {semver-3.0.2 → semver-3.0.4}/docs/usage/compare-versions-through-expression.rst +4 -0
  44. {semver-3.0.2 → semver-3.0.4}/docs/usage/compare-versions.rst +4 -0
  45. {semver-3.0.2 → semver-3.0.4}/docs/usage/convert-version-into-different-types.rst +5 -0
  46. {semver-3.0.2 → semver-3.0.4}/docs/usage/create-a-version.rst +4 -0
  47. {semver-3.0.2 → semver-3.0.4}/docs/usage/determine-version-equality.rst +4 -0
  48. {semver-3.0.2 → semver-3.0.4}/docs/usage/get-min-and-max-of-multiple-versions.rst +4 -0
  49. {semver-3.0.2 → semver-3.0.4}/docs/usage/semver-version.rst +1 -1
  50. semver-3.0.4/pyproject.toml +191 -0
  51. semver-3.0.4/release-procedure.md +145 -0
  52. semver-3.0.4/setup.cfg +17 -0
  53. {semver-3.0.2 → semver-3.0.4}/src/semver/__about__.py +1 -1
  54. {semver-3.0.2 → semver-3.0.4}/src/semver/__main__.py +1 -0
  55. {semver-3.0.2 → semver-3.0.4}/src/semver/_deprecated.py +1 -0
  56. {semver-3.0.2 → semver-3.0.4}/src/semver/version.py +12 -14
  57. {semver-3.0.2 → semver-3.0.4}/src/semver.egg-info/PKG-INFO +36 -9
  58. {semver-3.0.2 → semver-3.0.4}/src/semver.egg-info/SOURCES.txt +4 -0
  59. {semver-3.0.2 → semver-3.0.4}/tests/test_semver.py +1 -2
  60. {semver-3.0.2 → semver-3.0.4}/tests/test_subclass.py +18 -0
  61. {semver-3.0.2 → semver-3.0.4}/tox.ini +9 -27
  62. semver-3.0.4/uv.lock +1427 -0
  63. semver-3.0.2/MANIFEST.in +0 -8
  64. semver-3.0.2/docs/_templates/layout.html +0 -49
  65. semver-3.0.2/docs/build-semver.rst +0 -61
  66. semver-3.0.2/docs/requirements.txt +0 -5
  67. semver-3.0.2/pyproject.toml +0 -73
  68. semver-3.0.2/release-procedure.md +0 -123
  69. semver-3.0.2/setup.cfg +0 -93
  70. {semver-3.0.2 → semver-3.0.4}/.coveragerc +0 -0
  71. {semver-3.0.2 → semver-3.0.4}/CITATION.cff +0 -0
  72. {semver-3.0.2 → semver-3.0.4}/CONTRIBUTING.rst +0 -0
  73. {semver-3.0.2 → semver-3.0.4}/CONTRIBUTORS +0 -0
  74. {semver-3.0.2 → semver-3.0.4}/Makefile +0 -0
  75. {semver-3.0.2 → semver-3.0.4}/README.rst +0 -0
  76. {semver-3.0.2 → semver-3.0.4}/SUPPORT.md +0 -0
  77. {semver-3.0.2 → semver-3.0.4}/changelog.d/.gitignore +0 -0
  78. {semver-3.0.2 → semver-3.0.4}/changelog.d/README.rst +0 -0
  79. {semver-3.0.2 → semver-3.0.4}/changelog.d/_template.rst +0 -0
  80. {semver-3.0.2 → semver-3.0.4}/docs/_static/logo.svg +0 -0
  81. {semver-3.0.2 → semver-3.0.4}/docs/advanced/coerce.py +0 -0
  82. {semver-3.0.2 → semver-3.0.4}/docs/advanced/semverwithvprefix.py +0 -0
  83. {semver-3.0.2 → semver-3.0.4}/docs/changelog-semver3-devel.rst +0 -0
  84. {semver-3.0.2 → semver-3.0.4}/docs/changelog.rst +0 -0
  85. {semver-3.0.2 → semver-3.0.4}/docs/inventories/pydantic.inv +0 -0
  86. {semver-3.0.2 → semver-3.0.4}/docs/inventories/python-objects.inv +0 -0
  87. {semver-3.0.2 → semver-3.0.4}/docs/make.bat +0 -0
  88. {semver-3.0.2 → semver-3.0.4}/docs/readme.rst +0 -0
  89. {semver-3.0.2 → semver-3.0.4}/docs/usage/increase-parts-of-a-version_prereleases.rst +0 -0
  90. {semver-3.0.2 → semver-3.0.4}/docs/usage/index.rst +0 -0
  91. {semver-3.0.2 → semver-3.0.4}/docs/usage/parse-version-string.rst +0 -0
  92. {semver-3.0.2 → semver-3.0.4}/docs/usage/raise-parts-of-a-version.rst +0 -0
  93. {semver-3.0.2 → semver-3.0.4}/docs/usage/replace-parts-of-a-version.rst +0 -0
  94. {semver-3.0.2 → semver-3.0.4}/docs/usage/semver_org-version.rst +0 -0
  95. {semver-3.0.2 → semver-3.0.4}/docs/version-policy.rst +0 -0
  96. {semver-3.0.2 → semver-3.0.4}/src/semver/__init__.py +0 -0
  97. {semver-3.0.2 → semver-3.0.4}/src/semver/_types.py +0 -0
  98. {semver-3.0.2 → semver-3.0.4}/src/semver/cli.py +0 -0
  99. {semver-3.0.2 → semver-3.0.4}/src/semver/py.typed +0 -0
  100. {semver-3.0.2 → semver-3.0.4}/src/semver.egg-info/dependency_links.txt +0 -0
  101. {semver-3.0.2 → semver-3.0.4}/src/semver.egg-info/entry_points.txt +0 -0
  102. {semver-3.0.2 → semver-3.0.4}/src/semver.egg-info/top_level.txt +0 -0
  103. {semver-3.0.2 → semver-3.0.4}/tests/coerce.py +0 -0
  104. {semver-3.0.2 → semver-3.0.4}/tests/conftest.py +0 -0
  105. {semver-3.0.2 → semver-3.0.4}/tests/semverwithvprefix.py +0 -0
  106. {semver-3.0.2 → semver-3.0.4}/tests/test_bump.py +0 -0
  107. {semver-3.0.2 → semver-3.0.4}/tests/test_compare.py +0 -0
  108. {semver-3.0.2 → semver-3.0.4}/tests/test_deprecated_functions.py +0 -0
  109. {semver-3.0.2 → semver-3.0.4}/tests/test_docstrings.py +0 -0
  110. {semver-3.0.2 → semver-3.0.4}/tests/test_format.py +0 -0
  111. {semver-3.0.2 → semver-3.0.4}/tests/test_immutable.py +0 -0
  112. {semver-3.0.2 → semver-3.0.4}/tests/test_index.py +0 -0
  113. {semver-3.0.2 → semver-3.0.4}/tests/test_match.py +0 -0
  114. {semver-3.0.2 → semver-3.0.4}/tests/test_max-min.py +0 -0
  115. {semver-3.0.2 → semver-3.0.4}/tests/test_parsing.py +0 -0
  116. {semver-3.0.2 → semver-3.0.4}/tests/test_pysemver-cli.py +0 -0
  117. {semver-3.0.2 → semver-3.0.4}/tests/test_replace.py +0 -0
  118. {semver-3.0.2 → semver-3.0.4}/tests/test_typeerror-274.py +0 -0
@@ -4,6 +4,7 @@ root = true
4
4
  [*]
5
5
  end_of_line = lf
6
6
  charset = utf-8
7
+ max_line_length = 99
7
8
 
8
9
  [*.py]
9
10
  indent_style = space
@@ -108,7 +108,7 @@ celerybeat.pid
108
108
 
109
109
  # Environments
110
110
  .env
111
- .venv
111
+ .venv*
112
112
  env/
113
113
  venv/
114
114
  ENV/
@@ -0,0 +1,15 @@
1
+ [pytest]
2
+ norecursedirs = .git build .env/ env/ .pyenv/ .tmp/ .eggs/ venv/
3
+ testpaths = tests docs
4
+ pythonpath = src tests
5
+ filterwarnings =
6
+ ignore:Function 'semver.*:DeprecationWarning
7
+ # ' <- This apostroph is just to fix syntax highlighting
8
+ addopts =
9
+ --import-mode=importlib
10
+ --no-cov-on-fail
11
+ --cov=semver
12
+ --cov-report=term-missing
13
+ --doctest-glob='*.rst'
14
+ --doctest-modules
15
+ --doctest-report ndiff
@@ -10,11 +10,17 @@ build:
10
10
  os: ubuntu-22.04
11
11
  tools:
12
12
  python: "3.11"
13
+ jobs:
14
+ pre_install:
15
+ # - curl -LsSf https://astral.sh/uv/install.sh | sh
16
+ - pip install uv
17
+ - uv export --only-group docs --no-hashes --no-color > requirements-docs.txt
18
+ post_install:
19
+ - pip install -r requirements-docs.txt
20
+ pre_build:
21
+ - make -C docs html
13
22
 
14
23
  # Build documentation in the docs/ directory with Sphinx
15
24
  sphinx:
16
25
  configuration: docs/conf.py
17
26
 
18
- python:
19
- install:
20
- - requirements: docs/requirements.txt
@@ -0,0 +1,53 @@
1
+ #
2
+ # Configuration file for ruff
3
+ # See https://docs.astral.sh/ruff/configuration/
4
+
5
+ line-length = 88
6
+ indent-width = 4
7
+ include = [
8
+ "pyproject.toml",
9
+ "src/**/*.py",
10
+ "tests/**/*.py",
11
+ "docs/**/*.py",
12
+ ]
13
+
14
+ [lint]
15
+ extend-ignore = [
16
+ "RUF005",
17
+ "RUF012",
18
+ # Comment contains ambiguous `’` (RIGHT SINGLE QUOTATION MARK):
19
+ "RUF003",
20
+ "ISC001",
21
+ ]
22
+ select = [
23
+ "F", # pyflakes
24
+ "E", # pycodestyle
25
+ "I", # isort
26
+ "N", # pep8-naming
27
+ "UP", # pyupgrade
28
+ "RUF", # ruff
29
+ "B", # flake8-bugbear
30
+ "C4", # flake8-comprehensions
31
+ "ISC", # flake8-implicit-str-concat
32
+ "PTH", # flake8-use-pathlib
33
+ "SIM", # flake8-simplify
34
+ "TID", # flake8-tidy-imports
35
+ ]
36
+ # TODO: Remove ISC001 ignore when formatter updated: https://github.com/astral-sh/ruff/issues/8272
37
+
38
+
39
+ [format]
40
+ # Exclude type hint stub files from formatting.
41
+ exclude = ["*.pyi"]
42
+
43
+ # Like Black, use double quotes for strings.
44
+ quote-style = "double"
45
+
46
+ # Like Black, indent with spaces, rather than tabs.
47
+ indent-style = "space"
48
+
49
+ # Like Black, respect magic trailing commas.
50
+ skip-magic-trailing-comma = false
51
+
52
+ docstring-code-format = true
53
+ docstring-code-line-length = "dynamic"
@@ -18,11 +18,115 @@ 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.4
22
+ =============
23
+
24
+ :Released: 2025-01-24
25
+ :Maintainer: Tom Schraitle
26
+
27
+
28
+ Bug Fixes
29
+ ---------
30
+
31
+ * :gh:`459`: Fix 3.0.3:
32
+
33
+ * :pr:`457`: Re-enable Trove license identifier
34
+ * :pr:`456`: Fix source dist file
35
+
36
+
37
+ ----
38
+
39
+
40
+ Version 3.0.3
41
+ =============
42
+
43
+ :Released: 2025-01-18
44
+ :Maintainer: Tom Schraitle
45
+
46
+
47
+ Bug Fixes
48
+ ---------
49
+
50
+ * :pr:`453`: The check in ``_comparator`` does not match the check in :meth:`Version.compare`.
51
+ This breaks comparision with subclasses.
52
+
53
+
54
+
55
+ Improved Documentation
56
+ ----------------------
57
+
58
+ * :pr:`435`: Several small improvements for documentation:
59
+
60
+ * Add meta description to improve SEO
61
+ * Use canonicals on ReadTheDocs (commit 87f639f)
62
+ * Pin versions for reproducable doc builds (commit 03fb990)
63
+ * Add missing :file:`.readthedocs.yaml` file (commit ec9348a)
64
+ * Correct some smaller issues when building (commit f65feab)
65
+
66
+ * :pr:`436`: Move search box more at the top. This makes it easier for
67
+ users as if the TOC is long, the search box isn't visible
68
+ anymore.
69
+
70
+
71
+
72
+ Features
73
+ --------
74
+
75
+ * :pr:`439`: Improve type hints to fix TODOs
76
+
77
+
78
+
79
+ Internal Changes
80
+ ----------------
81
+
82
+ * :pr:`440`: Update workflow file
83
+
84
+ * :pr:`446`: Add Python 3.13 to GitHub Actions
85
+
86
+ * :pr:`447`: Modernize project configs with :file:`pyproject.toml` and
87
+ use Astral's uv command.
88
+
89
+ * In :file:`pyproject.toml`:
90
+
91
+ * Move all project related data from :file:`setup.cfg` to :file:`pyproject.toml`
92
+ * Use new dependency group from :pep:`735`
93
+ * Consolidate flake8, isort, pycodestyle with ruff
94
+ * Split towncrier config type "trivial" into "trivial" and "internal"
95
+
96
+ * Create config file for ruff (:file:`.ruff.toml`)
97
+ * Create config file for pytest (:file:`.pytest.ini`)
98
+ * Simplify :file:`tox.ini` and remove old stuff
99
+ * Document installation with new :command:`uv` command
100
+ * Simplify Sphinx config with :func:`find_version()`
101
+ * Update the authors
102
+ * Use :command:`uv` in GitHub Action :file:`python-testing.yml` workflow
103
+
104
+ * Update :file:`release-procedure.md`.
105
+
106
+ * :pr:`451`: Turn our Markdown issue templates into YAML
107
+
108
+
109
+ Trivial Changes
110
+ ---------------
111
+
112
+ * :pr:`438`: Replace organization placeholder in license
113
+
114
+ * :pr:`445`: Improve private :func:`_nat_cmp` method:
115
+
116
+ * Remove obsolete else.
117
+ * Find a better way to identify digits without the :mod:`re` module.
118
+ * Fix docstring in :meth:`Version.compare`
119
+
120
+
121
+
122
+ ----
123
+
124
+
21
125
  Version 3.0.2
22
126
  =============
23
127
 
24
128
  :Released: 2023-10-09
25
- :Maintainer:
129
+ :Maintainer: Tom Schraitle
26
130
 
27
131
 
28
132
  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
 
@@ -0,0 +1,26 @@
1
+ include *.md
2
+ include *.rst
3
+ include *.txt
4
+ include CONTRIBUTORS
5
+ include CITATION.cff
6
+ include Makefile
7
+ include changelog.d/*
8
+ graft docs/**
9
+ include tests/*.py
10
+ include tox.ini
11
+ include .pytest.ini
12
+ include .ruff.toml
13
+ include uv.lock
14
+
15
+ # The dot files:
16
+ include .coveragerc
17
+ include .editorconfig
18
+ include .gitignore
19
+ include .readthedocs.yaml
20
+
21
+
22
+ prune docs/_build
23
+ recursive-exclude .github *
24
+ prune docs/**/__pycache__
25
+
26
+ global-exclude __pycache__
@@ -1,22 +1,47 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: semver
3
- Version: 3.0.2
3
+ Version: 3.0.4
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
42
+ Classifier: Development Status :: 5 - Production/Stable
17
43
  Classifier: License :: OSI Approved :: BSD License
18
44
  Classifier: Operating System :: OS Independent
19
- Classifier: Programming Language :: Python
20
45
  Classifier: Programming Language :: Python :: 3
21
46
  Classifier: Programming Language :: Python :: 3.7
22
47
  Classifier: Programming Language :: Python :: 3.8
@@ -24,6 +49,8 @@ Classifier: Programming Language :: Python :: 3.9
24
49
  Classifier: Programming Language :: Python :: 3.10
25
50
  Classifier: Programming Language :: Python :: 3.11
26
51
  Classifier: Programming Language :: Python :: 3.12
52
+ Classifier: Programming Language :: Python :: 3.13
53
+ Classifier: Programming Language :: Python :: 3.14
27
54
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
55
  Requires-Python: >=3.7
29
56
  Description-Content-Type: text/x-rst
@@ -0,0 +1,4 @@
1
+ Fix 3.0.3:
2
+
3
+ * :pr:`457`: Re-enable Trove license identifier
4
+ * :pr:`456`: Fix source dist file
@@ -8,6 +8,12 @@ SPHINXPROJ = semver
8
8
  SOURCEDIR = .
9
9
  BUILDDIR = _build
10
10
 
11
+ # Set the source directory for your project
12
+ SRC_DIR = ../src
13
+
14
+ # Set the PYTHONPATH environment variable
15
+ export PYTHONPATH := $(SRC_DIR):$(PYTHONPATH)
16
+
11
17
  # Put it first so that "make" without argument is like "make help".
12
18
  help:
13
19
  @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -31,6 +31,10 @@ div.related.top nav {
31
31
  margin-bottom: -0.75em;
32
32
  }
33
33
 
34
+ #searchbox {
35
+ margin-bottom: 1.25em;
36
+ }
37
+
34
38
  .section h1 {
35
39
  font-weight: 700;
36
40
  }
@@ -0,0 +1,10 @@
1
+ {#
2
+ Import the theme's layout.
3
+ #}
4
+ {% extends "!layout.html" %}
5
+
6
+
7
+ {%- block extrahead %}
8
+ {{- super() }}
9
+ <meta name="generator" content="Toms"/>
10
+ {% endblock %}
@@ -1,6 +1,10 @@
1
1
  Combining Pydantic and semver
2
2
  =============================
3
3
 
4
+ .. meta::
5
+ :description lang=en:
6
+ Combining Pydantic and semver
7
+
4
8
  According to its homepage, `Pydantic <https://pydantic-docs.helpmanual.io>`_
5
9
  "enforces type hints at runtime, and provides user friendly errors when data
6
10
  is invalid."
@@ -1,6 +1,10 @@
1
- Converting versions between PyPI and semver
1
+ Converting Versions between PyPI and semver
2
2
  ===========================================
3
3
 
4
+ .. meta::
5
+ :description lang=en:
6
+ Converting versions between PyPI and semver
7
+
4
8
  .. Link
5
9
  https://packaging.pypa.io/en/latest/_modules/packaging/version.html#InvalidVersion
6
10
 
@@ -3,6 +3,10 @@
3
3
  Creating Subclasses from Version
4
4
  ================================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Creating subclasses from Version class
9
+
6
10
  If you do not like creating functions to modify the behavior of semver
7
11
  (as shown in section :ref:`sec_dealing_with_invalid_versions`), you can
8
12
  also create a subclass of the :class:`Version <semver.version.Version>` class.
@@ -3,6 +3,10 @@
3
3
  Dealing with Invalid Versions
4
4
  =============================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Dealing with invalid versions
9
+
6
10
  As semver follows the semver specification, it cannot parse version
7
11
  strings which are considered "invalid" by that specification. The semver
8
12
  library cannot know all the possible variations so you need to help the
@@ -3,6 +3,10 @@
3
3
  Displaying Deprecation Warnings
4
4
  ===============================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Displaying and filtering deprecation warnings
9
+
6
10
  By default, deprecation warnings are `ignored in Python <https://docs.python.org/3/library/warnings.html#warning-categories>`_.
7
11
  This also affects semver's own warnings.
8
12
 
@@ -1,6 +1,9 @@
1
1
  Advanced topics
2
2
  ===============
3
3
 
4
+ .. meta::
5
+ :description lang=en:
6
+ Advanced topics for Python semver
4
7
 
5
8
  .. toctree::
6
9
  :maxdepth: 1
@@ -1,8 +1,12 @@
1
1
  .. _sec_reading_versions_from_file:
2
2
 
3
- Reading versions from file
3
+ Reading Versions from File
4
4
  ==========================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Reading versions from file
9
+
6
10
  In cases where a version is stored inside a file, one possible solution
7
11
  is to use the following function:
8
12
 
@@ -3,6 +3,10 @@
3
3
  API Reference
4
4
  =============
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ API reference about Python semver
9
+
6
10
  .. currentmodule:: semver
7
11
 
8
12
 
@@ -0,0 +1,33 @@
1
+ .. _build-semver:
2
+
3
+ Building semver
4
+ ===============
5
+
6
+ .. meta::
7
+ :description lang=en:
8
+ Building semver
9
+
10
+ .. _Installing uv: https://docs.astral.sh/uv/getting-started/installation/
11
+
12
+
13
+ This project changed its way how it is built over time. We used to have
14
+ a :file:`setup.py` file, but switched to a :file:`pyproject.toml` setup.
15
+
16
+ The build process is managed by :command:`uv` command.
17
+
18
+ You need:
19
+
20
+ * Python 3.7 or newer.
21
+
22
+ * The :mod:`setuptools` module version 61 or newer which is used as
23
+ a build backend.
24
+
25
+ * The command :command:`uv` from Astral. Refer to the section
26
+ `Installing uv`_ for more information.
27
+
28
+
29
+ To build semver, run::
30
+
31
+ uv build
32
+
33
+ After the command is finished, you can find two files in the :file:`dist` folder: a ``.tar.gz`` and a ``.whl`` file.
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- # -*- coding: utf-8 -*-
3
2
  #
4
3
  # python-semver documentation build configuration file
5
4
  #
@@ -16,37 +15,31 @@
16
15
  # add these directories to sys.path here. If the directory is relative to the
17
16
  # documentation root, use os.path.abspath to make it absolute, like shown here.
18
17
  #
19
- import codecs
20
- from datetime import date
18
+
21
19
  import os
22
20
  import re
23
- import sys
21
+ from datetime import date
22
+ from pathlib import Path
24
23
 
25
- SRC_DIR = os.path.abspath("../src/")
26
- sys.path.insert(0, SRC_DIR)
27
- # from semver import __version__ # noqa: E402
24
+ SRC_DIR = Path(__file__).absolute().parent.parent / "src"
28
25
  YEAR = date.today().year
29
26
 
30
27
 
31
- def read(*parts):
32
- """
33
- Build an absolute path from *parts* and and return the contents of the
34
- resulting file. Assume UTF-8 encoding.
35
- """
36
- here = os.path.abspath(os.path.dirname(__file__))
37
- with codecs.open(os.path.join(here, *parts), "rb", "utf-8") as f:
38
- return f.read()
39
-
40
-
41
- def find_version(*file_paths):
28
+ def find_version(path: Path) -> str:
42
29
  """
43
30
  Build a path from *file_paths* and search for a ``__version__``
44
31
  string inside.
45
32
  """
46
- version_file = read(*file_paths)
47
- version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
33
+ content = Path(path).read_text(encoding="utf-8")
34
+
35
+ version_match = re.search(
36
+ r"^__version__ = ['\"]([^'\"]*)['\"]",
37
+ content,
38
+ re.MULTILINE
39
+ )
48
40
  if version_match:
49
41
  return version_match.group(1)
42
+
50
43
  raise RuntimeError("Unable to find version string.")
51
44
 
52
45
 
@@ -86,14 +79,14 @@ master_doc = "index"
86
79
  # General information about the project.
87
80
  project = "python-semver"
88
81
  copyright = f"{YEAR}, Kostiantyn Rybnikov and all"
89
- author = "Kostiantyn Rybnikov and all"
82
+ author = "Kostiantyn Rybnikov, Tom Schraitle, Sebastien Celles, and others"
90
83
 
91
84
  # The version info for the project you're documenting, acts as replacement for
92
85
  # |version| and |release|, also used in various other places throughout the
93
86
  # built documents.
94
87
  #
95
88
  # The short X.Y version.
96
- release = find_version("../src/semver/__about__.py")
89
+ release = find_version(SRC_DIR / "semver/__about__.py")
97
90
  # The full version, including alpha/beta/rc tags.
98
91
  version = release # .rsplit(u".", 1)[0]
99
92
 
@@ -174,7 +167,7 @@ html_theme_options = {
174
167
  "github_button": True,
175
168
  #:
176
169
  "github_type": "star",
177
- #: whether to apply a ‘Fork me on Github’ banner
170
+ #: whether to apply a "Fork me on Github" banner
178
171
  #: in the top right corner of the page:
179
172
  # "github_banner": True,
180
173
  #
@@ -211,6 +204,20 @@ html_theme_options = {
211
204
  html_static_path = ["_static"]
212
205
  html_css_files = ["css/custom.css"]
213
206
 
207
+ html_sidebars = {
208
+ "**": [
209
+ "about.html", # theme_logo
210
+ # 'relations.html', # prev and next
211
+ "searchbox.html", # basic/searchbox.html
212
+ "navigation.html", # TOC
213
+ # 'donate.html',
214
+ ]
215
+ }
216
+
217
+ # Canonical link relation
218
+ if os.environ.get("READTHEDOCS_CANONICAL_URL"):
219
+ html_baseurl = f"{os.environ['READTHEDOCS_CANONICAL_URL']}"
220
+
214
221
  # html_logo = "logo.svg"
215
222
 
216
223
  # -- Options for HTMLHelp output ------------------------------------------
@@ -3,5 +3,9 @@
3
3
  Adding a Changelog Entry
4
4
  ========================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Adding a changelog entry with Towncrier
9
+
6
10
  .. include:: ../../changelog.d/README.rst
7
11
  :start-after: -text-begin-
@@ -3,6 +3,10 @@
3
3
  Documenting semver
4
4
  ==================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Documenting semver with type annotations, docstrings, Sphinx directives
9
+
6
10
  Documenting the features of semver is very important. It gives our developers
7
11
  an overview what is possible with semver, how it "feels", and how it is
8
12
  used efficiently.
@@ -3,6 +3,10 @@
3
3
  Finish the Release
4
4
  ==================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Finish the semver release by creating tags
9
+
6
10
  1. Create a tag:
7
11
 
8
12
  $ git tag -a x.x.x
@@ -3,6 +3,10 @@
3
3
  Contributing to semver
4
4
  ======================
5
5
 
6
+ .. meta::
7
+ :description lang=en:
8
+ Contributing to Python semver
9
+
6
10
  The semver source code is managed using Git and is hosted on GitHub::
7
11
 
8
12
  git clone git://github.com/python-semver/python-semver
@@ -1,6 +1,10 @@
1
1
  Prerequisites
2
2
  -------------
3
3
 
4
+ .. meta::
5
+ :description lang=en:
6
+ Overview of prerequisites for contributing
7
+
4
8
  .. -text-begin-
5
9
 
6
10
  Before you make changes to the code, we would highly appreciate if you
@@ -1,6 +1,10 @@
1
1
  Release Procedure
2
2
  =================
3
3
 
4
+ .. meta::
5
+ :description lang=en:
6
+ Release procedure: prepare and create the release
7
+
4
8
  The following procedures gives a short overview of what steps are needed
5
9
  to create a new release.
6
10