Poetry plugin to get package version from git
Project description
Poetry Git Version Plugin
Poetry plugin to get package version from git.
Functionality
- Git tag parsing
- Make alpha version
- Substitution of the project tag (if any) in the poetry.version value
- Maintenance of PEP 440
- Command to output a new version
Quick start
poetry self add poetry-git-version-plugin
poetry git-version # Write your git tag
poetry -v git-version # print process
Dependencies
Installed Git
and:
[tool.poetry.dependencies]
python = ">=3.8"
poetry = ">=1.2.2"
Setup
[tool.poetry-git-version-plugin]
# If the tag is not found on the HEAD,
# then the version is built based on the last found tag and the HEAD
# Example: 1.3.2a5
# Default = true
make_alpha_version = true
# Format for alpha version
# Default = '{version}a{distance}'
# Example:
alpha_version_format = '{version}+{distance}' # -> 1.3.2a5
alpha_version_format = '{version}a{distance}+{commit_hash}' # -> 1.3.2a5-5babef6
# Available variables:
# - version: Last found tag
# - distance: Distance from last found tag to HEAD
# - commit_hash: Commit hash
# Ignore mismatch error PEP440 version format
# Default = true
ignore_pep440 = true
# Ignore mismatch error PEP440 public version format
# Default = true
ignore_public_pep440 = true
# Ignore all errors
# including version not found errors
ignore_errors = true
Contribute
Issue Tracker: https://gitlab.com/rocshers/python/poetry-git-version-plugin/-/issues
Source Code: https://gitlab.com/rocshers/python/poetry-git-version-plugin
Before adding changes:
make install
After changes:
make format test
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
Close
Hashes for poetry_git_version_plugin-0.1.1.dev12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617bd0646730e9dae3582dd3ca1ad93b8fdfca06f922cd0738c1ebf0435c5dcb |
|
MD5 | 881f17be66de5549ea07fe15cfb19379 |
|
BLAKE2b-256 | e1526ba293023a79e214f9d5de516017088c580ac188ca866d6a1ab4bc0489a3 |
Close
Hashes for poetry_git_version_plugin-0.1.1.dev12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c68f431c9efb99f60f7d9d6c536baa18c34886787d4a0eedb8cfc5b4c4dbd86 |
|
MD5 | fa9fe9d1bdd8f00720250fe0cd62f22e |
|
BLAKE2b-256 | 7bf133a6e3a313807575aad02484afa9d700ed2c38d54a6e0c51b5c36ec4d1e7 |