Skip to main content

print semantic version for git projects

Project description


Print Semantic Version for Git project.

Intended usage: makefiles and build scripts to print meaningful project version.


Let's take this repo as example

* 4cf9ba3 (HEAD -> master) sync 11
* ac24825 sync 10
* 73745a4 sync 9
| * 856d14b (feat2) sync 8
| * 1fcbaf1 sync 7
| * 2a02f9b sync 6
* b62e51a (tag: 1.3.0) sync 5
* 027b518 sync 4
| * d58163e (feat1) sync 3
| * d658ddc sync 2
* 217658d (tag: 1.0.0) sync 1
* ad3d54e initial commit

Running lu-semver for project's refs give below output

command output
lu-semver 1.3.1-rc.3.git.4cf9ba3
lu-semver --ver @same 1.3.0-dev.3.git.4cf9ba3
lu-semver --ver @next --fmt 'branch,count:pfx=rc,scm,extra' 1.3.1-rc.3.git.4cf9ba3
lu-semver --ver @next --fmt 'branch,count:pfx=rc,scm,extra' --extra gcc.9 1.3.1-rc.3.git.4cf9ba3.gcc.9
lu-semver --ver @same --fmt 'branch,count,extra' --extra gcc.9 1.3.0-dev.3.gcc.9
lu-semver --ver @latest latest
lu-semver --ver @latest feat1 latest-feat1
lu-semver feat1 1.0.1-feat1.rc.2.git.d58163e
lu-semver --fmt 'branch,count,extra' --extra gcc.9 feat1
lu-semver feat2 1.3.1-feat2.rc.3.git.856d14b
lu-semver 1.3.0 1.3.0

Format of Release info

Release info format is a coma separated list of plugins, where a plugin is a string of the form 'name:arg1=val1:arg2=val2'. Args are optional.

Plugins: branch - prints branch name unless or nothing if it's in 'omit' list min: branch default: branch:omit=master ex1: branch:omit=master,v8.0

count - prints number of commits from last tag or nothing for tags min: count default: count:pfx=dev ex1: count:pfx=rc

extra - prints 'extra' command line option min: extra default: extra

scm - prints SCM info. Only git is currently supported. min: scm default: scm:pfx=git ex1: scm:pfx=hash

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

lu_semver-4.0.1-py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page