Skip to main content

print semantic version for git projects

Project description

lu-semver

Print Semantic Version for Git project.

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

Usage

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 1.0.1-feat1.dev.2.gcc.9
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.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file lu_semver-4.0.2-py3-none-any.whl.

File metadata

  • Download URL: lu_semver-4.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.9

File hashes

Hashes for lu_semver-4.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 363c0910a07132c57fa76f655ad655d47ae57cb1de6342dd0be88d046d33b6e2
MD5 da0058457748145abb0abdd52d434007
BLAKE2b-256 fea1fa93c647052633728b4878f26fd8d2a7d9c833ce6310659bb140272b9859

See more details on using hashes here.

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