version-bumper 0.1.0__py3-none-any.whl
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.
- version_bumper/__init__.py +29 -0
- version_bumper/__main__.py +214 -0
- version_bumper/clibones/__init__.py +44 -0
- version_bumper/clibones/application_settings.py +210 -0
- version_bumper/clibones/config_file.py +157 -0
- version_bumper/clibones/config_file_base.py +26 -0
- version_bumper/clibones/info_control.py +83 -0
- version_bumper/clibones/json_config_file.py +35 -0
- version_bumper/clibones/logger_control.py +114 -0
- version_bumper/clibones/toml_config_file.py +34 -0
- version_bumper/commands.py +157 -0
- version_bumper/pyproject.py +50 -0
- version_bumper/version.py +456 -0
- version_bumper-0.1.0.dist-info/METADATA +284 -0
- version_bumper-0.1.0.dist-info/RECORD +17 -0
- version_bumper-0.1.0.dist-info/WHEEL +4 -0
- version_bumper-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: version_bumper
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python package version utility to bump a version by parts.
|
|
5
|
+
Project-URL: version_bumper, https://github.com/royw/version_bumper
|
|
6
|
+
Author-email: Roy Wright <roy@wright.org>
|
|
7
|
+
Maintainer-email: Roy Wright <roy@wright.org>
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) <year> <copyright holders>
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
+
Keywords: CLI,application,python
|
|
18
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: Intended Audience :: Developers
|
|
21
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
22
|
+
Classifier: Natural Language :: English
|
|
23
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
24
|
+
Classifier: Programming Language :: Python :: 3
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Requires-Dist: loguru<0.8.0,>=0.7.2
|
|
27
|
+
Requires-Dist: pathvalidate<4.0.0,>=3.2.0
|
|
28
|
+
Requires-Dist: tomlkit<0.13.0,>=0.12.5
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: blacken-docs<2.0.0,>=1.18.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: build<2.0.0,>=1.2.1; extra == 'dev'
|
|
32
|
+
Requires-Dist: check-pyproject<0.2.0,>=0.1.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: fawltydeps<0.16.0,>=0.15.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: flict<2.0.0,>=1.2.14; extra == 'dev'
|
|
35
|
+
Requires-Dist: httpx<0.28.0,>=0.27.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: liccheck<0.10.0,>=0.9.2; extra == 'dev'
|
|
37
|
+
Requires-Dist: mypy<2.0.0,>=1.10.1; extra == 'dev'
|
|
38
|
+
Requires-Dist: pip-tools<8.0.0,>=7.4.1; extra == 'dev'
|
|
39
|
+
Requires-Dist: pre-commit<4.0.0,>=3.7.1; extra == 'dev'
|
|
40
|
+
Requires-Dist: pyupgrade<4.0.0,>=3.16.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: reuse<4.0.0,>=3.0.2; extra == 'dev'
|
|
42
|
+
Requires-Dist: ruff<0.5.0,>=0.4.7; extra == 'dev'
|
|
43
|
+
Requires-Dist: shellcheck-py<0.11.0,>=0.10.0.1; extra == 'dev'
|
|
44
|
+
Requires-Dist: toml-cli<0.8.0,>=0.7.0; extra == 'dev'
|
|
45
|
+
Requires-Dist: twine<6.0.0,>=5.1.1; extra == 'dev'
|
|
46
|
+
Requires-Dist: validate-pyproject<0.19.0,>=0.18.0; extra == 'dev'
|
|
47
|
+
Provides-Extra: docs
|
|
48
|
+
Requires-Dist: mkdocs-gen-files<0.6.0,>=0.5.0; extra == 'docs'
|
|
49
|
+
Requires-Dist: mkdocs-literate-nav<0.7.0,>=0.6.1; extra == 'docs'
|
|
50
|
+
Requires-Dist: mkdocs-material<10.0.0,>=9.5.25; extra == 'docs'
|
|
51
|
+
Requires-Dist: mkdocs-section-index<0.4.0,>=0.3.9; extra == 'docs'
|
|
52
|
+
Requires-Dist: mkdocs<2.0.0,>=1.6.0; extra == 'docs'
|
|
53
|
+
Requires-Dist: mkdocstrings-python<2.0.0,>=1.10.3; extra == 'docs'
|
|
54
|
+
Requires-Dist: mkdocstrings<0.26.0,>=0.25.1; extra == 'docs'
|
|
55
|
+
Provides-Extra: metrics
|
|
56
|
+
Requires-Dist: radon<7.0.0,>=6.0.1; extra == 'metrics'
|
|
57
|
+
Provides-Extra: sphinx
|
|
58
|
+
Requires-Dist: furo<2025.0.0,>=2024.5.6; extra == 'sphinx'
|
|
59
|
+
Requires-Dist: myst-parser<4.0.0,>=3.0.1; extra == 'sphinx'
|
|
60
|
+
Requires-Dist: sphinx-autodoc-typehints<3.0.0,>=2.1.1; extra == 'sphinx'
|
|
61
|
+
Requires-Dist: sphinx-copybutton<0.6.0,>=0.5.2; extra == 'sphinx'
|
|
62
|
+
Requires-Dist: sphinx<8.0.0,>=7.3.7; extra == 'sphinx'
|
|
63
|
+
Provides-Extra: test
|
|
64
|
+
Requires-Dist: coverage[toml]<8.0.0,>=7.5.4; extra == 'test'
|
|
65
|
+
Requires-Dist: pytest-cov<6.0.0,>=5.0.0; extra == 'test'
|
|
66
|
+
Requires-Dist: pytest<9.0.0,>=8.2.2; extra == 'test'
|
|
67
|
+
Requires-Dist: tox<5.0.0,>=4.14.2; extra == 'test'
|
|
68
|
+
Description-Content-Type: text/markdown
|
|
69
|
+
|
|
70
|
+
<!--
|
|
71
|
+
SPDX-FileCopyrightText: 2024 Roy Wright
|
|
72
|
+
SPDX-License-Identifier: MIT
|
|
73
|
+
-->
|
|
74
|
+
|
|
75
|
+
# Version Bumper
|
|
76
|
+
|
|
77
|
+
[](https://pypi.org/project/version_bumper)
|
|
78
|
+
[](https://pypi.org/project/version_bumper)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Table of Contents
|
|
83
|
+
|
|
84
|
+
<!-- TOC -->
|
|
85
|
+
|
|
86
|
+
- [Version Bumper](#version-bumper)
|
|
87
|
+
- [Table of Contents](#table-of-contents)
|
|
88
|
+
- [Overview](#overview)
|
|
89
|
+
- [Usage](#usage)
|
|
90
|
+
- [Installation](#installation)
|
|
91
|
+
- [PyPI Installation](#pypi-installation)
|
|
92
|
+
- [Development Installation](#development-installation)
|
|
93
|
+
- [Development Prerequisites](#development-prerequisites)
|
|
94
|
+
- [License](#license)
|
|
95
|
+
- [References](#references)
|
|
96
|
+
<!-- TOC -->
|
|
97
|
+
|
|
98
|
+
## Overview
|
|
99
|
+
|
|
100
|
+
Oh, no! Not another version bump utility!
|
|
101
|
+
|
|
102
|
+
`version_bumper` is a PyPA Version compliant bumper that can bump (increment
|
|
103
|
+
by 1) any part of the version and supports pyproject.toml's project.version and
|
|
104
|
+
tool.poetry.version key/value pairs.
|
|
105
|
+
|
|
106
|
+
What this means is:
|
|
107
|
+
|
|
108
|
+
- `version_bumper` fully complies with the version definition in the Python
|
|
109
|
+
Packaging Authority's (PyPA) (https://www.pypa.io/) Python Packaging User
|
|
110
|
+
Guide
|
|
111
|
+
[Version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers)
|
|
112
|
+
specification (originally PEP440).
|
|
113
|
+
|
|
114
|
+
- `version_bumper` manages the version(s) in the
|
|
115
|
+
[pyproject.toml](https://packaging.python.org/en/latest/specifications/pyproject-toml/#pyproject-toml-spec)
|
|
116
|
+
file.
|
|
117
|
+
|
|
118
|
+
- Poetry uses the key/value pair `tool.poetry.version` (expecting this to
|
|
119
|
+
change when version 2 is released)
|
|
120
|
+
- other tools use the current PyPA standard key/value pair `project.version`
|
|
121
|
+
- `project.version` is required to exist.
|
|
122
|
+
- if `tool.poetry.version` exists, then it will be updated when
|
|
123
|
+
`project.version` is updated.
|
|
124
|
+
- if `tool.poetry.version` does not exist, then `version_bumper` will NOT
|
|
125
|
+
create it.
|
|
126
|
+
|
|
127
|
+
- `version_bumper` lets you set or bump individual parts of the version as well
|
|
128
|
+
as setting or getting the full version.
|
|
129
|
+
|
|
130
|
+
- `version_bumper` supports input and output in json, text (for bash scripts),
|
|
131
|
+
or human-readable console.
|
|
132
|
+
|
|
133
|
+
- `version_bumper` has a full suite (100% coverage) of tests that serve as both
|
|
134
|
+
examples and validation.
|
|
135
|
+
|
|
136
|
+
## Usage
|
|
137
|
+
|
|
138
|
+
Let's demonstrate what version_bumper can do.
|
|
139
|
+
|
|
140
|
+
➤ version_bumper
|
|
141
|
+
usage: Version Bumper [-h] [--config FILE] [--save-config] [--save-config-as FILE] [-v] [--longhelp] [--loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--debug] [--quiet] [--logfile LOGFILE]
|
|
142
|
+
{bump,version,set,get,release} ...
|
|
143
|
+
Version Bumper: error: A command argument (set, get, bump, release, version) or an informational option (--help, --longhelp, --version) is required
|
|
144
|
+
|
|
145
|
+
OK, so we have to give it a command or an informational option. I'll leave the
|
|
146
|
+
informational options as an exercise for the reader.
|
|
147
|
+
|
|
148
|
+
Valid help commands are:
|
|
149
|
+
|
|
150
|
+
➤ version_bumper --help
|
|
151
|
+
➤ version_bumper set --help
|
|
152
|
+
➤ version_bumper get --help
|
|
153
|
+
...
|
|
154
|
+
|
|
155
|
+
Let's get the version(s):
|
|
156
|
+
|
|
157
|
+
➤ version_bumper get
|
|
158
|
+
project.version: 0.1.1
|
|
159
|
+
tool.poetry.version: 0.1.1
|
|
160
|
+
|
|
161
|
+
and as json:
|
|
162
|
+
|
|
163
|
+
➤ version_bumper get --json
|
|
164
|
+
{"project.version": "0.1.1", "tool.poetry.version": "0.1.1"}
|
|
165
|
+
|
|
166
|
+
and as text:
|
|
167
|
+
|
|
168
|
+
➤ version_bumper get --text
|
|
169
|
+
0.1.1
|
|
170
|
+
0.1.1
|
|
171
|
+
|
|
172
|
+
For getting the version in a bash script, you probably want to specify which
|
|
173
|
+
version and get just a single value:
|
|
174
|
+
|
|
175
|
+
➤ PROJECT_VERSION=$(version_bumper get --text --project)
|
|
176
|
+
➤ echo $PROJECT_VERSION
|
|
177
|
+
0.1.1
|
|
178
|
+
|
|
179
|
+
Setting the version(s) in the pyproject is simple:
|
|
180
|
+
|
|
181
|
+
➤ version_bumper version "1.2.3a4+54321" --json
|
|
182
|
+
{"version": "1.2.3a4+54321"}
|
|
183
|
+
|
|
184
|
+
Setting the prerelease part of the version without change any other part:
|
|
185
|
+
|
|
186
|
+
➤ version_bumper set a 5 --json
|
|
187
|
+
{"version": "1.2.3a5+54321"}
|
|
188
|
+
|
|
189
|
+
Now let's say we want to bump the pre-release (a5):
|
|
190
|
+
|
|
191
|
+
➤ version_bumper bump a --json
|
|
192
|
+
{"version": "1.2.3a6"}
|
|
193
|
+
|
|
194
|
+
Notice bumping clears everything to the right, unless you are bumping the epoch:
|
|
195
|
+
|
|
196
|
+
➤ version_bumper bump epoch
|
|
197
|
+
version: 1!1.2.3a6
|
|
198
|
+
|
|
199
|
+
The set command can optional clear everything to the right:
|
|
200
|
+
|
|
201
|
+
➤ version_bumper bump dev
|
|
202
|
+
version: 1!1.2.3a6.dev1
|
|
203
|
+
➤ version_bumper set local "foo0123"
|
|
204
|
+
version: 1!1.2.3a6.dev1+foo0123
|
|
205
|
+
➤ version_bumper set minor 4
|
|
206
|
+
version: 1!1.4.3a6.dev1+foo0123
|
|
207
|
+
➤ version_bumper set minor 5 --clear-right
|
|
208
|
+
version: 1!1.5.0
|
|
209
|
+
|
|
210
|
+
Let's set the epoch back to 0:
|
|
211
|
+
|
|
212
|
+
➤ version_bumper set epoch 0
|
|
213
|
+
version: 1.5.0
|
|
214
|
+
|
|
215
|
+
And now make it a release candidate:
|
|
216
|
+
|
|
217
|
+
➤ version_bumper bump rc --json
|
|
218
|
+
{"version": "1.5.0rc1"}
|
|
219
|
+
|
|
220
|
+
Finally let's make it the release version:
|
|
221
|
+
|
|
222
|
+
➤ version_bumper release --json
|
|
223
|
+
{"version": "1.5.0"}
|
|
224
|
+
|
|
225
|
+
Please see the unit tests in tests/ directory for more examples.
|
|
226
|
+
|
|
227
|
+
## Installation
|
|
228
|
+
|
|
229
|
+
### PyPI Installation
|
|
230
|
+
|
|
231
|
+
`pip install version_bumper`
|
|
232
|
+
|
|
233
|
+
### Development Installation
|
|
234
|
+
|
|
235
|
+
#### Development Prerequisites
|
|
236
|
+
|
|
237
|
+
- Install the task manager: [Task](https://taskfile.dev/)
|
|
238
|
+
- Optionally install [pyenv-installer](https://github.com/pyenv/pyenv-installer)
|
|
239
|
+
|
|
240
|
+
- Install dependent pythons, example:
|
|
241
|
+
|
|
242
|
+
`pyenv local 3.11.9 3.12.3`
|
|
243
|
+
|
|
244
|
+
_Note you may need to install some libraries for the pythons to compile
|
|
245
|
+
cleanly._ _For example on ubuntu (note I prefer `nala` over `apt`):_
|
|
246
|
+
|
|
247
|
+
`sudo nala install tk-dev libbz2-dev libreadline-dev libsqlite3-dev lzma-dev python3-tk libreadline-dev`
|
|
248
|
+
|
|
249
|
+
- Recommended to upgrade pip to latest.
|
|
250
|
+
- Optionally install [Poetry](https://python-poetry.org/)
|
|
251
|
+
- Optionally install [Hatch](https://hatch.pypa.io/)
|
|
252
|
+
- Install [pip-tools](https://pypi.org/project/pip-tools/)
|
|
253
|
+
- Optionally install [setuptools](https://setuptools.pypa.io/)
|
|
254
|
+
- Install [build](https://build.pypa.io/)
|
|
255
|
+
- Install [pip-tools](https://pypi.org/project/pip-tools/)
|
|
256
|
+
- Install [twine](https://twine.readthedocs.io/)
|
|
257
|
+
|
|
258
|
+
Install the package using your favorite dev tool. Examples:
|
|
259
|
+
|
|
260
|
+
- `git clone git@github.com:royw/version_bumper.git`
|
|
261
|
+
- `cd version_bumper`
|
|
262
|
+
- `task init`
|
|
263
|
+
- `task build`
|
|
264
|
+
|
|
265
|
+
_Note, `task init` will run `git init .`, `git add` the initial project files,
|
|
266
|
+
and do a `git commit`. If you are using another VCS, please first edit the init
|
|
267
|
+
task in the `Taskfile.yaml` file._
|
|
268
|
+
|
|
269
|
+
See the [Developer README](DEV-README.md) for detailed information on the
|
|
270
|
+
development environment.
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
`version_bumper` is distributed under the terms of the
|
|
275
|
+
[MIT](https://spdx.org/licenses/MIT.html) license.
|
|
276
|
+
|
|
277
|
+
## References
|
|
278
|
+
|
|
279
|
+
- The [Python Packaging User Guide](https://packaging.python.org/en/latest)
|
|
280
|
+
- The
|
|
281
|
+
[pyproject.toml specification](https://pypi.python.org/pypi/pyproject.toml)
|
|
282
|
+
- The [Poetry pyproject.toml metadata](https://python-poetry.org/docs/pyproject)
|
|
283
|
+
- [pip documentation](https://pip.pypa.io/en/stable/)
|
|
284
|
+
- [Setuptools](https://setuptools.pypa.io/)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version_bumper/__init__.py,sha256=Fyjj2xhX4fHImd5m1KIrsrp1duFT0Xgi_N-4x90imtg,936
|
|
2
|
+
version_bumper/__main__.py,sha256=XRqkZDaD4vbVdCoa2LxXyuJqwoF88cHrP9gEsff7eKY,8981
|
|
3
|
+
version_bumper/commands.py,sha256=00TLiO64p_iAVvVO4UBcxee5AYnFIM-al-wzTU3e-uY,6089
|
|
4
|
+
version_bumper/pyproject.py,sha256=oF5ug3E3fn1nWvdrhCSnPiAeUW8olGPjELFImaPuMTs,1916
|
|
5
|
+
version_bumper/version.py,sha256=_xrcyWrPQuHMFYcb10gcNzFQgO_4rk2khGsOnq0tdqE,19932
|
|
6
|
+
version_bumper/clibones/__init__.py,sha256=utiK9y2KFvRafP_1aG6vjshz9IU7b5cOF91IyVCp8j4,1587
|
|
7
|
+
version_bumper/clibones/application_settings.py,sha256=cmtSA8DI2-gq-7vT_IOwvFiECmOr1DmMZ6rsStfkdHk,7897
|
|
8
|
+
version_bumper/clibones/config_file.py,sha256=0c7ne_aUr5MsRsGvODqqjqkK5n1XhwWROQWgIRlW4Co,6488
|
|
9
|
+
version_bumper/clibones/config_file_base.py,sha256=R4P0ahHOzwNYAPEd7ODbfo0n40CikWMzKR6KTXODTBI,539
|
|
10
|
+
version_bumper/clibones/info_control.py,sha256=FjJ6eU7WM8Xzn_gCecOjQpzg9OPaQiThl5-TI20hJL8,2867
|
|
11
|
+
version_bumper/clibones/json_config_file.py,sha256=APWJU1KrCjB-h3uDycb6Zu5f7ECMNCxgQ1tedqrMR8M,1156
|
|
12
|
+
version_bumper/clibones/logger_control.py,sha256=wmaUipkkVo5qJYjtZRCK_taM1OCLZpE8wCUsmA8aq4Y,3808
|
|
13
|
+
version_bumper/clibones/toml_config_file.py,sha256=ZWT-kQPFN-3N7mvbfqgmfq0i2FUfCLzjBzFfYGv3jT8,1112
|
|
14
|
+
version_bumper-0.1.0.dist-info/METADATA,sha256=bT7-1Ob0CVwLE8-WETkku6oI_KM1yRtAz8AFRLvsLpQ,10833
|
|
15
|
+
version_bumper-0.1.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
16
|
+
version_bumper-0.1.0.dist-info/entry_points.txt,sha256=OfQETetUvwmCobXvsJsn3J1VnCbh8FbQRozpYNyHSAY,64
|
|
17
|
+
version_bumper-0.1.0.dist-info/RECORD,,
|