update doc

This commit is contained in:
cclecle
2023-03-18 21:06:39 +00:00
parent 3ce09a0194
commit fff52596b1
2 changed files with 12 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
# Usage
## Installation
From master repository:
python -m pip install git+https://chacha.ddns.net/gitea/chacha/pygitversionhelper.git@master
@@ -14,6 +15,7 @@ From public repository:
TBD
## Import in your project
Add this line on the top of your python script:
#from pygitversionhelper import gitversionhelper
@@ -23,6 +25,7 @@ Add this line on the top of your python script:
#from pygitversionhelper import gitversionhelperException
## Basic API
All the API commands are static and so it is not needed to create instantiate any object.
They are all executed in the current active directory.
@@ -33,12 +36,14 @@ One easy way to change directory:
os.chdir("<YOUR DIRECTORY>")
### sublib: repository
To check if a repository is dirty:
if gitversionhelper.repository.isDirty():
print("repository is dirty")
### sublib: tag
List all tags (default to taggerdate order):
for tag in gitversionhelper.tag.getTags():
@@ -67,6 +72,7 @@ Get the distance from HEAD to last tag (only on same branch):
print(f"number of commit since last tag: {gitversionhelper.tag.getDistanceFromTag(same_branch=True)}")
### sublib: version
Get the last found version in the repository (return MetaVersion object):
print(f"most recent repository version: {gitversionhelper.tag.getLastVersion()}")
@@ -100,6 +106,8 @@ kwargs available to those function:
- output_format: string to choose a rendering format ("Auto","PEP440" or "SemVer")
## Limitations
There is unfortunately some technical limitation :
- MultiThreading and async behavior is not tested.
- Multiple tag on the same commit is not supported.
- Branch filter when searching for a version is only tested with -no-ff strategy