Skip to main content

Get a descriptive version string in a git repository.

Project description

GitAutoVersion generates a version string for the current working directory in a git repository in the format:

<major>.<minor>.<patch>[.<misc>][-<prerelease>][+<upcount>][!<caveat>][#<metadata>]

Installation

Installation through the Python Package Index (PyPi) is recommended:

pip --install GitAutoVersion

Usage

This package provides the funtion getVersionString which returns the generated version string for the working direcory of the given repository. It requires a git repository object of the GitPython module as argument.

version = GitAutoVersion.getVersionString(git_repo)

You can modify the text for the special flags:

flag_development:str = "DEVELOPMENT"

Indicating that the version is in a development branch.

flag_git:str = "git"

Indicating that the metadata-chunk is a git Sha-1 hash

flag_branch:str = "branch"

How do you call a “branch”?

flag_dirty:str = "DIRTY"

What to say if the working directory is dirty

Caveats

This project is under development. It may break at any time.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

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

Source Distribution

GitAutoVersion-0.0.12.dev0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

GitAutoVersion-0.0.12.dev0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file GitAutoVersion-0.0.12.dev0.tar.gz.

File metadata

  • Download URL: GitAutoVersion-0.0.12.dev0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.0.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

File hashes

Hashes for GitAutoVersion-0.0.12.dev0.tar.gz
Algorithm Hash digest
SHA256 9dc58ec7bc00d6c36a70f7df3d1ed313291176567f686e16261822a039446ec3
MD5 5826db1c066f352a7e239a38a83b7211
BLAKE2b-256 820d0013d89c5bff0c72ddd7841640a22788a1468be32fcaa402797005e491cb

See more details on using hashes here.

File details

Details for the file GitAutoVersion-0.0.12.dev0-py3-none-any.whl.

File metadata

  • Download URL: GitAutoVersion-0.0.12.dev0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.0.1 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

File hashes

Hashes for GitAutoVersion-0.0.12.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6301be078163384e78714debb856aa82bf66ad8fc4b80d078f974808dcbf4cf
MD5 3c03954670dea1b4f2d60cde828d61cd
BLAKE2b-256 47d6732c593c7fd992eab8fcff867e734fb5c6e9aa6165aeab02fed64611ebfa

See more details on using hashes here.

Supported by

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