bumpcalver


Namebumpcalver JSON
Version 2024.10.20.4 PyPI version JSON
download
home_pageNone
SummaryA CLI tool for calendar-based version bumping
upload_time2024-10-20 20:14:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Mike 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 calendar versioning calver cli library python versioning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version fury.io](https://badge.fury.io/py/bumpcalver.svg)](https://pypi.python.org/pypi/bumpcalver/)
[![Downloads](https://static.pepy.tech/badge/bumpcalver)](https://pepy.tech/project/bumpcalver)
[![Downloads](https://static.pepy.tech/badge/bumpcalver/month)](https://pepy.tech/project/bumpcalver)
[![Downloads](https://static.pepy.tech/badge/bumpcalver/week)](https://pepy.tech/project/bumpcalver)

Support Python Versions

![Static Badge](https://img.shields.io/badge/Python-3.13%20%7C%203.12%20%7C%203.11%20%7C%203.10%20%7C%203.9-blue)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Coverage Status](./coverage-badge.svg?dummy=8484744)](./reports/coverage/index.html)
[![Tests Status](./tests-badge.svg?dummy=8484744)](./reports/coverage/index.html)

CI/CD Pipeline:

[![Testing - Main](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml/badge.svg?branch=main)](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml)
[![Testing - Dev](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml/badge.svg?branch=dev)](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml)

SonarCloud:

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=coverage)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=alert_status)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)

# BumpCalver CLI Documentation

## Note
This project should be consider in beta and is not yet ready for production use.

## Overview

The **BumpCalver CLI** is a command-line interface for calendar-based version bumping. It automates the process of updating version strings in your project's files based on the current date and build count. Additionally, it can create Git tags and commit changes automatically. The CLI is highly configurable via a `pyproject.toml` file and supports various customization options to fit your project's needs.

---

## Table of Contents
- Documentation Site: [BumpCalver CLI](https://devsetgo.github.io/bumpcalver/)

- [Installation](#installation)
- [Getting Started](#getting-started)
- [Configuration](#configuration)
  - [Example Configuration](#example-configuration)
- [Command-Line Usage](#command-line-usage)
  - [Options](#options)
- [Examples](#examples)
- [Error Handling](#error-handling)
- [Support](#support)

---

## Installation

To install the BumpCalver CLI, you can add it to your project's dependencies. If it's packaged as a Python module, you might install it via:

```bash
pip install bumpcalver
```

*Note: Replace the installation command with the actual method based on how the package is distributed.*

---

## Getting Started

1. **Configure Your Project**: Create or update the `pyproject.toml` file in your project's root directory to include the `[tool.bumpcalver]` section with your desired settings.

2. **Run the CLI**: Use the `bumpcalver` command with appropriate options to bump your project's version.

Example:

```bash
bumpcalver --build --git-tag --auto-commit
```

---

## Configuration

The BumpCalver CLI relies on a `pyproject.toml` configuration file located at the root of your project. This file specifies how versioning should be handled, which files to update, and other settings.

### Configuration Options

- `version_format` (string): Format string for the version. Should include `{current_date}` and `{build_count}` placeholders.
- `timezone` (string): Timezone for date calculations (e.g., `UTC`, `America/New_York`).
- `file` (list of tables): Specifies which files to update and how to find the version string.
  - `path` (string): Path to the file to be updated.
  - `file_type` (string): Type of the file (e.g., `python`, `toml`, `yaml`, `json`, `xml`, `dockerfile`, `makefile`).
  - `variable` (string, optional): The variable name that holds the version string in the file.
  - `pattern` (string, optional): A regex pattern to find the version string.
  - `version_standard` (string, optional): The versioning standard to follow (e.g., `python` for PEP 440).
- `git_tag` (boolean): Whether to create a Git tag with the new version.
- `auto_commit` (boolean): Whether to automatically commit changes when creating a Git tag.

### Example Configuration

```toml
[tool.bumpcalver]
version_format = "{current_date}-{build_count:03}"
timezone = "America/New_York"
git_tag = true
auto_commit = true

[[tool.bumpcalver.file]]
path = "pyproject.toml"
file_type = "toml"
variable = "project.version"
version_standard = "python"

[[tool.bumpcalver.file]]
path = "examples/makefile"
file_type = "makefile"
variable = "APP_VERSION"
version_standard = "default"

[[tool.bumpcalver.file]]
path = "examples/dockerfile"
file_type = "dockerfile"
variable = "arg.VERSION"
version_standard = "default"

[[tool.bumpcalver.file]]
path = "examples/dockerfile"
file_type = "dockerfile"
variable = "env.APP_VERSION"
version_standard = "default"

[[tool.bumpcalver.file]]
path = "examples/p.py"
file_type = "python"
variable = "__version__"
version_standard = "python"
```

---

## Command-Line Usage

The CLI provides several options to customize the version bumping process.

```bash
Usage: bumpcalver [OPTIONS]

Options:
  --beta                      Use beta versioning.
  --build                     Use build count versioning.
  --timezone TEXT             Timezone for date calculations (default: value
                              from config or America/New_York).
  --git-tag / --no-git-tag    Create a Git tag with the new version.
  --auto-commit / --no-auto-commit
                              Automatically commit changes when creating a Git
                              tag.
  --help                      Show this message and exit.
```

### Options

- `--beta`: Prefixes the version with `beta-`.
- `--build`: Increments the build count based on the current date.
- `--timezone`: Overrides the timezone specified in the configuration.
- `--git-tag` / `--no-git-tag`: Forces Git tagging on or off, overriding the configuration.
- `--auto-commit` / `--no-auto-commit`: Forces auto-commit on or off, overriding the configuration.

---

## Examples

### Basic Version Bump

To bump the version using the current date and build count:

```bash
bumpcalver --build
```

### Beta Versioning

To create a beta version:

```bash
bumpcalver --build --beta
```

### Specifying Timezone

To use a specific timezone:

```bash
bumpcalver --build --timezone Europe/London
```

### Creating a Git Tag with Auto-Commit

To bump the version, commit changes, and create a Git tag:

```bash
bumpcalver --build --git-tag --auto-commit
```

---

## Error Handling

- **Unknown Timezone**: If an invalid timezone is specified, the default timezone (`America/New_York`) is used, and a warning is printed.
- **File Not Found**: If a specified file is not found during version update, an error message is printed.
- **Invalid Build Count**: If the existing build count in a file is invalid, it resets to `1`, and a warning is printed.
- **Git Errors**: Errors during Git operations are caught, and an error message is displayed.
- **Malformed Configuration**: If the `pyproject.toml` file is malformed, an error is printed, and the program exits.

---

## Support

For issues or questions, please open an issue on the project's repository.

---

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bumpcalver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "calendar versioning, calver, cli, library, python, versioning",
    "author": null,
    "author_email": "Mike Ryan <mikeryan56@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/94/74284009deeca537a9b9b32521c8e60aae196cb8c73322137e61b453d534/bumpcalver-2024.10.20.4.tar.gz",
    "platform": null,
    "description": "[![PyPI version fury.io](https://badge.fury.io/py/bumpcalver.svg)](https://pypi.python.org/pypi/bumpcalver/)\n[![Downloads](https://static.pepy.tech/badge/bumpcalver)](https://pepy.tech/project/bumpcalver)\n[![Downloads](https://static.pepy.tech/badge/bumpcalver/month)](https://pepy.tech/project/bumpcalver)\n[![Downloads](https://static.pepy.tech/badge/bumpcalver/week)](https://pepy.tech/project/bumpcalver)\n\nSupport Python Versions\n\n![Static Badge](https://img.shields.io/badge/Python-3.13%20%7C%203.12%20%7C%203.11%20%7C%203.10%20%7C%203.9-blue)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Coverage Status](./coverage-badge.svg?dummy=8484744)](./reports/coverage/index.html)\n[![Tests Status](./tests-badge.svg?dummy=8484744)](./reports/coverage/index.html)\n\nCI/CD Pipeline:\n\n[![Testing - Main](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml/badge.svg?branch=main)](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml)\n[![Testing - Dev](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml/badge.svg?branch=dev)](https://github.com/devsetgo/bumpcalver/actions/workflows/testing.yml)\n\nSonarCloud:\n\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=coverage)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=alert_status)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)\n[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=devsetgo_bumpcalver&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=devsetgo_bumpcalver)\n\n# BumpCalver CLI Documentation\n\n## Note\nThis project should be consider in beta and is not yet ready for production use.\n\n## Overview\n\nThe **BumpCalver CLI** is a command-line interface for calendar-based version bumping. It automates the process of updating version strings in your project's files based on the current date and build count. Additionally, it can create Git tags and commit changes automatically. The CLI is highly configurable via a `pyproject.toml` file and supports various customization options to fit your project's needs.\n\n---\n\n## Table of Contents\n- Documentation Site: [BumpCalver CLI](https://devsetgo.github.io/bumpcalver/)\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Configuration](#configuration)\n  - [Example Configuration](#example-configuration)\n- [Command-Line Usage](#command-line-usage)\n  - [Options](#options)\n- [Examples](#examples)\n- [Error Handling](#error-handling)\n- [Support](#support)\n\n---\n\n## Installation\n\nTo install the BumpCalver CLI, you can add it to your project's dependencies. If it's packaged as a Python module, you might install it via:\n\n```bash\npip install bumpcalver\n```\n\n*Note: Replace the installation command with the actual method based on how the package is distributed.*\n\n---\n\n## Getting Started\n\n1. **Configure Your Project**: Create or update the `pyproject.toml` file in your project's root directory to include the `[tool.bumpcalver]` section with your desired settings.\n\n2. **Run the CLI**: Use the `bumpcalver` command with appropriate options to bump your project's version.\n\nExample:\n\n```bash\nbumpcalver --build --git-tag --auto-commit\n```\n\n---\n\n## Configuration\n\nThe BumpCalver CLI relies on a `pyproject.toml` configuration file located at the root of your project. This file specifies how versioning should be handled, which files to update, and other settings.\n\n### Configuration Options\n\n- `version_format` (string): Format string for the version. Should include `{current_date}` and `{build_count}` placeholders.\n- `timezone` (string): Timezone for date calculations (e.g., `UTC`, `America/New_York`).\n- `file` (list of tables): Specifies which files to update and how to find the version string.\n  - `path` (string): Path to the file to be updated.\n  - `file_type` (string): Type of the file (e.g., `python`, `toml`, `yaml`, `json`, `xml`, `dockerfile`, `makefile`).\n  - `variable` (string, optional): The variable name that holds the version string in the file.\n  - `pattern` (string, optional): A regex pattern to find the version string.\n  - `version_standard` (string, optional): The versioning standard to follow (e.g., `python` for PEP 440).\n- `git_tag` (boolean): Whether to create a Git tag with the new version.\n- `auto_commit` (boolean): Whether to automatically commit changes when creating a Git tag.\n\n### Example Configuration\n\n```toml\n[tool.bumpcalver]\nversion_format = \"{current_date}-{build_count:03}\"\ntimezone = \"America/New_York\"\ngit_tag = true\nauto_commit = true\n\n[[tool.bumpcalver.file]]\npath = \"pyproject.toml\"\nfile_type = \"toml\"\nvariable = \"project.version\"\nversion_standard = \"python\"\n\n[[tool.bumpcalver.file]]\npath = \"examples/makefile\"\nfile_type = \"makefile\"\nvariable = \"APP_VERSION\"\nversion_standard = \"default\"\n\n[[tool.bumpcalver.file]]\npath = \"examples/dockerfile\"\nfile_type = \"dockerfile\"\nvariable = \"arg.VERSION\"\nversion_standard = \"default\"\n\n[[tool.bumpcalver.file]]\npath = \"examples/dockerfile\"\nfile_type = \"dockerfile\"\nvariable = \"env.APP_VERSION\"\nversion_standard = \"default\"\n\n[[tool.bumpcalver.file]]\npath = \"examples/p.py\"\nfile_type = \"python\"\nvariable = \"__version__\"\nversion_standard = \"python\"\n```\n\n---\n\n## Command-Line Usage\n\nThe CLI provides several options to customize the version bumping process.\n\n```bash\nUsage: bumpcalver [OPTIONS]\n\nOptions:\n  --beta                      Use beta versioning.\n  --build                     Use build count versioning.\n  --timezone TEXT             Timezone for date calculations (default: value\n                              from config or America/New_York).\n  --git-tag / --no-git-tag    Create a Git tag with the new version.\n  --auto-commit / --no-auto-commit\n                              Automatically commit changes when creating a Git\n                              tag.\n  --help                      Show this message and exit.\n```\n\n### Options\n\n- `--beta`: Prefixes the version with `beta-`.\n- `--build`: Increments the build count based on the current date.\n- `--timezone`: Overrides the timezone specified in the configuration.\n- `--git-tag` / `--no-git-tag`: Forces Git tagging on or off, overriding the configuration.\n- `--auto-commit` / `--no-auto-commit`: Forces auto-commit on or off, overriding the configuration.\n\n---\n\n## Examples\n\n### Basic Version Bump\n\nTo bump the version using the current date and build count:\n\n```bash\nbumpcalver --build\n```\n\n### Beta Versioning\n\nTo create a beta version:\n\n```bash\nbumpcalver --build --beta\n```\n\n### Specifying Timezone\n\nTo use a specific timezone:\n\n```bash\nbumpcalver --build --timezone Europe/London\n```\n\n### Creating a Git Tag with Auto-Commit\n\nTo bump the version, commit changes, and create a Git tag:\n\n```bash\nbumpcalver --build --git-tag --auto-commit\n```\n\n---\n\n## Error Handling\n\n- **Unknown Timezone**: If an invalid timezone is specified, the default timezone (`America/New_York`) is used, and a warning is printed.\n- **File Not Found**: If a specified file is not found during version update, an error message is printed.\n- **Invalid Build Count**: If the existing build count in a file is invalid, it resets to `1`, and a warning is printed.\n- **Git Errors**: Errors during Git operations are caught, and an error message is displayed.\n- **Malformed Configuration**: If the `pyproject.toml` file is malformed, an error is printed, and the program exits.\n\n---\n\n## Support\n\nFor issues or questions, please open an issue on the project's repository.\n\n---\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Mike  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.",
    "summary": "A CLI tool for calendar-based version bumping",
    "version": "2024.10.20.4",
    "project_urls": {
        "Documentation": "https://devsetgo.github.io/bumpcalver/",
        "Homepage": "https://github.com/devsetgo/bumpcalver",
        "Repository": "https://github.com/devsetgo/bumpcalver"
    },
    "split_keywords": [
        "calendar versioning",
        " calver",
        " cli",
        " library",
        " python",
        " versioning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3c27c435b2602519c02ed4cdd8a36424edda6b245e94cf0c9c241b68f9b7eb4",
                "md5": "d3fa004e1943eeec168738686d82a010",
                "sha256": "8558c6e485a47145f9f618f923ced72b6a8269bad6e1c79ee1cc55ebba0ea868"
            },
            "downloads": -1,
            "filename": "bumpcalver-2024.10.20.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3fa004e1943eeec168738686d82a010",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11894,
            "upload_time": "2024-10-20T20:14:34",
            "upload_time_iso_8601": "2024-10-20T20:14:34.930658Z",
            "url": "https://files.pythonhosted.org/packages/a3/c2/7c435b2602519c02ed4cdd8a36424edda6b245e94cf0c9c241b68f9b7eb4/bumpcalver-2024.10.20.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "909474284009deeca537a9b9b32521c8e60aae196cb8c73322137e61b453d534",
                "md5": "9da91711eb3b0ae5ad73d43d33f5a90b",
                "sha256": "3cd0028d38f68e7bcdcdc355ef888644ef45a408dd614e1405de5466f27098b9"
            },
            "downloads": -1,
            "filename": "bumpcalver-2024.10.20.4.tar.gz",
            "has_sig": false,
            "md5_digest": "9da91711eb3b0ae5ad73d43d33f5a90b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 44825,
            "upload_time": "2024-10-20T20:14:36",
            "upload_time_iso_8601": "2024-10-20T20:14:36.591193Z",
            "url": "https://files.pythonhosted.org/packages/90/94/74284009deeca537a9b9b32521c8e60aae196cb8c73322137e61b453d534/bumpcalver-2024.10.20.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-20 20:14:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "devsetgo",
    "github_project": "bumpcalver",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "bumpcalver"
}
        
Elapsed time: 2.71558s