https://github.com/cielquan/verbum
Python version bumper.
https://github.com/cielquan/verbum
Last synced: 3 months ago
JSON representation
Python version bumper.
- Host: GitHub
- URL: https://github.com/cielquan/verbum
- Owner: Cielquan
- License: mit
- Created: 2022-06-04T11:05:06.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-10T17:24:41.000Z (3 months ago)
- Last Synced: 2025-03-10T18:37:21.805Z (3 months ago)
- Language: Python
- Size: 172 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
# verbum
A version bumping library.
## Examle
```python
from verbum import verbumcurrent_release = "1.1.1"
new_release = verbum.bump_version(current_release, verbum.BumpType.ALPHA)
print(new_release) # 1.1.1a1
```## Version strings
### Input
verbum is opinionated and version strings accepted by `bump_version` are a subset of valid strings
specified in [PEP440](https://peps.python.org/pep-0440/).### Output
Version strings output by `bump_version` are [PEP440](https://peps.python.org/pep-0440/) compliant.
### Ruleset on top of PEP440
1. Three version numbers are mandatory: `X.Y.Z`.
2. A leading forth number (epoch) is forbidden.
3. Pre-release identifier like alpha, beta and release-candidates are only allowed with their
abbreviations:
- `alpha` -> `a`
- `beata` -> `b`
- `release-candidate` -> `rc`
4. Other variante as `rc` are not supported for release-candidates.
5. Pre-release identifier must follow the scheme `{a|b|rc}N` where `N` is an interger.
6. Pre-release and post-release counter must start with 1 not 0.
A 0 is interpreted as not set. This means e.g. bumping a post-release on this `1.1.1rc0`
would result in `1.1.1.post1`.
7. Additional identifiers or separators are forbidden.### Valid examples
```text
1.2.3a1
1.2.3b1
1.2.3rc1
1.2.31.2.3.post1
1.2.3a1.post1
1.2.3b1.post1
1.2.3rc1.post1
```