A small utility to handle semantic versioning using only git tags
Project description
Vinnie the Versioner
Overview
vinnie is a small utility to handle semantic versioning
using only git tags. This can be done either manually or as part of CI.
Motivation
The motivation for building Vinnie is somewhat small and trivial. Many existing tools force you to keep the current version in a file in your git repository which often means that during a CI build process you generate a commit that is simply incrementing the version number. By no means is this the end of the world, but we realized we could fairly safely just use git tags as the storage mechanism for the current version.
Usage
Calling vinnie on its own prints the help.
vinnie version prints the current version to stdout.
vinnie (patch|minor|major) increments the version number of the given level, creates the tag, and pushes it. You can skip pushing by using vinnie --no-push
vinnie next (patch|minor|major) determines the next version number of the
given level and prints it to stdout.
vinnie replace /path/to/file will replace the marker (default of __VINNIE_VERSION__)
in this file with the current version.
vinnie show-config dumps the current configuration Vinnie is operating with,
mostly for debugging.
Nonsemantic versioning
Vinnie also supports not using semver by just using an
incrementing integer (v1, v2, ... v47) if you wish. To do that you need to
always pass in the option --no-semver and then the only incrementing
command to use is bump.
$ vinnie --no-semver bump
Options
--repo set the filesystem path to the root of the git checkout
--repo-url set the URL on a supported provider for the repository
--github-token GitHub API token
--gitlab-token GitLab API token
--push/--no-push push or don't push to the repo. The default is to push.
--prefix allows you to set an optional text prefix to all version numbers, for
example, vinnie --prefix=v would create version numbers such as v0.0.1.
--omit-prefix suppresses the prefix from output. The tag will be processed
using the prefix, but the output will just contain the version numbers such as
0.0.1.
--semver/--no-semver sets whether or not you want to use semantic versioning
or just an incrementing integer. The default is to use semver.
--current-version in some situations it's nice to be able to just tell Vinnie
what the current version is, this option allows you to do that. In this case,
Vinnie ignores whatever versions actually exist as tags on the repository.
Environment Variables
Vinnie also listens for environment variables if you would prefer to use those the following map to the given option
VINNIE_REPO_PATHsets--repoVINNIE_REPO_URLsets--repo-urlVINNIE_GITHUB_TOKENsets--github-tokenVINNIE_GITLAB_TOKENsets--gitlab-tokenVINNIE_REPO_PUSHsets--pushVINNIE_PREFIXsets--prefixVINNIE_OMIT_PREFIXsets--omit-prefixVINNIE_CURRENT_VERSIONsets--current-versionVINNIE_GIT_REMOTEsets--remoteVINNIE_VERSION_MARKERsets--markerVINNIE_SEMVER=Falsesets--no-semverVINNIE_SEMVER=Truesets--semverwhich is the default
Examples
Let's start with a simple example:
$ cd my-git-repo
$ vinnie version
0.0.0
$ vinnie patch
0.0.1
Or maybe you want to use a prefix on with a project that already has been
using semver in a pattern of vX.Y.Z in tags, you would then just need to do:
$ cd my-git-repo
$ vinnie --prefix=v version
v1.2.3
$ vinnie --prefix=v minor
v1.3.0
Similar Projects
Vinnie is very similar to these other fine projects:
Roadmap / TODO
We feel this is pretty feature complete, but definitely open to suggestions!
License
BSD Licensed
Author
Originally written by Frank Wiles frank@revsys.com and brought to you by REVSYS.
Keep in touch!
If you have a question about this project, please open a GitHub issue. If you love us and want to keep track of our goings-on, here's where you can find us online:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vinnie-0.9.0.tar.gz.
File metadata
- Download URL: vinnie-0.9.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5744c1d3ed4b7ede4c6cdd28ba3792a6a0dd57c8ed3c6c7ba604f3e19ec9232e
|
|
| MD5 |
907f92940f47e8847530774bd22c7e50
|
|
| BLAKE2b-256 |
8636155b9a8deeec022ccbfba50a3eb4972eea0e9b9914c8ce61bb798a8d9c3d
|
File details
Details for the file vinnie-0.9.0-py3-none-any.whl.
File metadata
- Download URL: vinnie-0.9.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82420503ffc90d101c311f578c50e987ed43e9438f5c262b174f5dc0958b9aa1
|
|
| MD5 |
c7d26cc4de96782876f13adc50b6fb8b
|
|
| BLAKE2b-256 |
d1897b496c61aac9e54d6aac5c5c0d7fd81ee4b8a5339e135cf9024577eb9340
|