tag-creator


Nametag-creator JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryAutomatically create git release tags based on a merged commit message and previous tag.
upload_time2025-02-16 09:37:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT License Copyright (c) 2024 Vladyslav Honcharenko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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.
keywords git tag create git tag git release tag semver tag
VCS
bugtrack_url
requirements PyYAML
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Tag creator

Tag Creator is a Python tool that automatically generates release tags follow [SemVer](https://semver.org/) conventions.
It's designed to streamline the process of creating version tags for software projects, ensuring consistency and saving time.
Each new release tag will be created based on the latest tag version for the provided git branch. Increments for new version
will be parsed from the commit message. Commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.

Each commit must start from the allowed [type](tag_creator/configuration.yml) to find increments for next tag based on it.
Be avare that the `MAJOR` verion rule is differnt. Commits still can start from the allowed types in the `MAJOR` section, however there are several
additional rules:

- script will interpret commits with the `!` character after the allowed type as a major verion
- allowed type can be declared in a description. E.g.:

```
fix: some fix

BREAKING CHANGE: this is a breaking change!
```

Initial list of types in the configuration provided by [conventional-changelog](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional#type-enum).

## Features

- Automatically generates release tags
- Easy integration into existing workflows
- Lightweight and configurable

## Examples

Use --help option to see available scripts arguments.

### Show the latest tag for branch

Since project tags have the `v` prefix before versions, `--tag_prefix="v"` argument passed.

```python
python -m tag_creator --current_version --release_branch="main" --tag_prefix="v"
__main__ INFO: Current tag: v0.0.3 Branch: main
```

Internal command to search a tag will be: `git -C . tag --merged 'main' --sort=creatordate --list 'v[0-9]*\.[0-9]*\.[0-9]*'`.

### Create new release tag

To create new tag with push to remote use `--create_new_tag ` argument. Add `--dry_run` argument if you do not need to update your remote.
```python
python -m tag_creator --create_new_tag --tag_prefix="v" --release_branch="main"

version INFO: Current version is: v0.0.4
14:36:01 version INFO: Determine increments for new tag based on commit (MR) msg: docs: foo-bar

version INFO: New tag will be created and pushed. Tag: v0.0.5, message Automatically created tag
```

To create new tag from the bunch of commits, e.g. in case of merge not squashed merge request, use `--start_from` option.
It allows to parse all commits from the specified version to current HEAD and select the highest increment, based on
commit messages. Be aware, that only current HEAD are not allowed to contain a tag!

See your CI preferences to obtain a commit before your merge.

### See or change the configuration


You can provide a custom configuration file to change the default majority-to-type match to change the script behaviour.
Default configuration file is located [here](tag_creator/configuration.yml)
Be aware that configs will not be joined when you provide new config file.

See default config:

```python
python -m tag_creator --show_config

__main__ INFO: commit_types:
- majority: major
  type:
  - BREAKING_CHANGE
  - BREAKING CHANGE
- majority: minor
  type:
  - feat
  - build
  - ci
  - revert
- majority: patch
  type:
  - fix
  - docs
  - refactor
  - perf
  - test
  - chore
  - style
```

Update config (follow the same structure as in the default configuration file):

```python
python -m tag_creator --config="$HOME/custom_cfg.yml" --show_config
configuration INFO: Custom config read!
__main__ INFO: commit_types:
- majority: major
  type:
  - major
- majority: minor
  type:
  - minor
- majority: patch
  type:
  - patch
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tag-creator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Vladyslav Honcharenko <goncharvlad02@gmail.com>",
    "keywords": "git, tag, create git tag, git release tag, semver tag",
    "author": null,
    "author_email": "Vladyslav Honcharenko <goncharvlad02@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/05/cc/6be744dfd7691436d470b69fe334b4f5ef7e70154b96175d645e731e4f44/tag_creator-0.1.0.tar.gz",
    "platform": null,
    "description": "## Tag creator\n\nTag Creator is a Python tool that automatically generates release tags follow [SemVer](https://semver.org/) conventions.\nIt's designed to streamline the process of creating version tags for software projects, ensuring consistency and saving time.\nEach new release tag will be created based on the latest tag version for the provided git branch. Increments for new version\nwill be parsed from the commit message. Commit messages must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.\n\nEach commit must start from the allowed [type](tag_creator/configuration.yml) to find increments for next tag based on it.\nBe avare that the `MAJOR` verion rule is differnt. Commits still can start from the allowed types in the `MAJOR` section, however there are several\nadditional rules:\n\n- script will interpret commits with the `!` character after the allowed type as a major verion\n- allowed type can be declared in a description. E.g.:\n\n```\nfix: some fix\n\nBREAKING CHANGE: this is a breaking change!\n```\n\nInitial list of types in the configuration provided by [conventional-changelog](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional#type-enum).\n\n## Features\n\n- Automatically generates release tags\n- Easy integration into existing workflows\n- Lightweight and configurable\n\n## Examples\n\nUse --help option to see available scripts arguments.\n\n### Show the latest tag for branch\n\nSince project tags have the `v` prefix before versions, `--tag_prefix=\"v\"` argument passed.\n\n```python\npython -m tag_creator --current_version --release_branch=\"main\" --tag_prefix=\"v\"\n__main__ INFO: Current tag: v0.0.3 Branch: main\n```\n\nInternal command to search a tag will be: `git -C . tag --merged 'main' --sort=creatordate --list 'v[0-9]*\\.[0-9]*\\.[0-9]*'`.\n\n### Create new release tag\n\nTo create new tag with push to remote use `--create_new_tag ` argument. Add `--dry_run` argument if you do not need to update your remote.\n```python\npython -m tag_creator --create_new_tag --tag_prefix=\"v\" --release_branch=\"main\"\n\nversion INFO: Current version is: v0.0.4\n14:36:01 version INFO: Determine increments for new tag based on commit (MR) msg: docs: foo-bar\n\nversion INFO: New tag will be created and pushed. Tag: v0.0.5, message Automatically created tag\n```\n\nTo create new tag from the bunch of commits, e.g. in case of merge not squashed merge request, use `--start_from` option.\nIt allows to parse all commits from the specified version to current HEAD and select the highest increment, based on\ncommit messages. Be aware, that only current HEAD are not allowed to contain a tag!\n\nSee your CI preferences to obtain a commit before your merge.\n\n### See or change the configuration\n\n\nYou can provide a custom configuration file to change the default majority-to-type match to change the script behaviour.\nDefault configuration file is located [here](tag_creator/configuration.yml)\nBe aware that configs will not be joined when you provide new config file.\n\nSee default config:\n\n```python\npython -m tag_creator --show_config\n\n__main__ INFO: commit_types:\n- majority: major\n  type:\n  - BREAKING_CHANGE\n  - BREAKING CHANGE\n- majority: minor\n  type:\n  - feat\n  - build\n  - ci\n  - revert\n- majority: patch\n  type:\n  - fix\n  - docs\n  - refactor\n  - perf\n  - test\n  - chore\n  - style\n```\n\nUpdate config (follow the same structure as in the default configuration file):\n\n```python\npython -m tag_creator --config=\"$HOME/custom_cfg.yml\" --show_config\nconfiguration INFO: Custom config read!\n__main__ INFO: commit_types:\n- majority: major\n  type:\n  - major\n- majority: minor\n  type:\n  - minor\n- majority: patch\n  type:\n  - patch\n```\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2024 Vladyslav Honcharenko\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Automatically create git release tags based on a merged commit message and previous tag.",
    "version": "0.1.0",
    "project_urls": {
        "Repository": "https://github.com/Oberstmarschall/tag_creator"
    },
    "split_keywords": [
        "git",
        " tag",
        " create git tag",
        " git release tag",
        " semver tag"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "48275366e2e6c168fe765b131ea7aad46747091c73d08c81d4a8fa9412d55cbd",
                "md5": "3acab6d013d49ebb036dbe7acfc18879",
                "sha256": "6e28f8a439f667942f19884afbf03bf0c5e0fa650c08b3cc6b8f1305a6596b20"
            },
            "downloads": -1,
            "filename": "tag_creator-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3acab6d013d49ebb036dbe7acfc18879",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 9986,
            "upload_time": "2025-02-16T09:37:17",
            "upload_time_iso_8601": "2025-02-16T09:37:17.126894Z",
            "url": "https://files.pythonhosted.org/packages/48/27/5366e2e6c168fe765b131ea7aad46747091c73d08c81d4a8fa9412d55cbd/tag_creator-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "05cc6be744dfd7691436d470b69fe334b4f5ef7e70154b96175d645e731e4f44",
                "md5": "c7eb3928bd28f0068616a94dfa88cdbc",
                "sha256": "b44cc907551df0d9a909dd2ab8cd68ee68cbb009537e0e7a4b1d5ce4774cd9f6"
            },
            "downloads": -1,
            "filename": "tag_creator-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c7eb3928bd28f0068616a94dfa88cdbc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 11026,
            "upload_time": "2025-02-16T09:37:18",
            "upload_time_iso_8601": "2025-02-16T09:37:18.951997Z",
            "url": "https://files.pythonhosted.org/packages/05/cc/6be744dfd7691436d470b69fe334b4f5ef7e70154b96175d645e731e4f44/tag_creator-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-16 09:37:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Oberstmarschall",
    "github_project": "tag_creator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0.2"
                ]
            ]
        }
    ],
    "lcname": "tag-creator"
}
        
Elapsed time: 0.61802s