uv-version


Nameuv-version JSON
Version 0.1.9.post1 PyPI version JSON
download
home_pageNone
SummaryCLI tool for managing package version
upload_time2024-11-15 12:37:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords rocshers uvxt
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # uv-version

CLI tool for managing package version

[![PyPI](https://img.shields.io/pypi/v/uv-version)](https://pypi.org/project/uv-version/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/uv-version)](https://pypi.org/project/uv-version/)
[![uvxt](https://img.shields.io/badge/family-uvxt-purple)](https://pypi.org/project/uvxt/)

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=rocshers_uv-version&metric=coverage)](https://sonarcloud.io/summary/new_code?id=rocshers_uv-version)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rocshers_uv-version&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rocshers_uv-version)

[![Downloads](https://static.pepy.tech/badge/uv-version)](https://pepy.tech/project/uv-version)
[![GitLab stars](https://img.shields.io/gitlab/stars/rocshers/python/uv-version)](https://gitlab.com/rocshers/python/uv-version)
[![GitLab last commit](https://img.shields.io/gitlab/last-commit/rocshers/python/uv-version)](https://gitlab.com/rocshers/python/uv-version)

## Functionality

- Parsing: `git`, `pyproject.toml`, `env`, `stdin`
- Output to: `pyproject.toml`, `stdout`
- `Increment`

## Quick start

```bash
uvx uv-version increment
```

## Configs

## Commands

### Arguments for using version

- `--to-pyproject`: Set a new version in pyproject.toml. \[Default\]
- `--to-print`: Print the new version to the console.

### Arguments for getting version

- `--from-pyproject`: Version is determined by the value in pyproject.toml project.version \[Default\]
- `--from-git`: Version is determined based on the `git status`
- `--from-stdin`: Version is expected as the last argument of the call or from stdin
- `--from-env`: Version is expected in the environment variable `$PACKAGE_VERSION`.

You can use multiple attributes together.

When retrieving the version from different sources, keep in mind that the **highest version will be used** in the end.

### uvx increment

Increases the version by 1

```bash
$ uvx uv-version --to-print
0.1.1
$ uvx uv-version --to-print increment prerelease
0.1.2a1
$ uvx uv-version --to-print increment micro
0.1.3
$ uvx uv-version --to-print increment minor
0.2.0
$ uvx uv-version --to-print increment major
1.0.0
```

## Use cases

### Publishing python package to pypi via uv with version equal to git tag

.gitlab-ci.yml:

```yaml
pypi:
  stage: publishing
  image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
  tags:
    - docker
  script:
    - apt install git
    - uvx uv-version --from-git
    - uv build --no-sources
    - uv publish
  rules:
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
```

- When creating a git tag: new package with version == {TAG}
- When pushing to CI_DEFAULT_BRANCH: new package with version == {TAG}a{N}

### Publishing python package to private pypi via uv with version equal to git tag and commit hash

.gitlab-ci.yml:

```yaml
pypi:
  stage: publishing
  image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim
  tags:
    - docker
  script:
    - apt install git
    # set alpha version template
    - PACKAGE_VERSION_ALPHA_VERSION_FORMAT='{version}a{distance}+{commit_hash}'
    # Update package version
    - uvx uv-version --from-git
    # Publishing to gitlab
    - UV_PUBLISH_URL=https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/pypi
    - UV_PUBLISH_TOKEN=${PYPI_TOKEN}
    - uv build --no-sources
    - uv publish
  rules:
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
```

- When creating a git tag: new package with version == {TAG}
- When pushing to CI_DEFAULT_BRANCH: new package with version == {TAG}a{N}+{COMMIT_HASH}

## Roadmap

- logging
- tests
- version construct
- Set to `__init__`, `__version__`,`VERSION` files

## Contribute

Issue Tracker: <https://gitlab.com/rocshers/python/uv-version/-/issues>  
Source Code: <https://gitlab.com/rocshers/python/uv-version>

Before adding changes:

```bash
make install-dev
```

After changes:

```bash
make format test
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "uv-version",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "rocshers, uvxt",
    "author": null,
    "author_email": "Alekse Marusich <alekse.marusich@rocshers.com>",
    "download_url": "https://files.pythonhosted.org/packages/69/83/9ff7930a525be19a9000e6de650220570871a9aa21d188657793934b6eb1/uv_version-0.1.9.post1.tar.gz",
    "platform": null,
    "description": "# uv-version\n\nCLI tool for managing package version\n\n[![PyPI](https://img.shields.io/pypi/v/uv-version)](https://pypi.org/project/uv-version/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/uv-version)](https://pypi.org/project/uv-version/)\n[![uvxt](https://img.shields.io/badge/family-uvxt-purple)](https://pypi.org/project/uvxt/)\n\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=rocshers_uv-version&metric=coverage)](https://sonarcloud.io/summary/new_code?id=rocshers_uv-version)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rocshers_uv-version&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rocshers_uv-version)\n\n[![Downloads](https://static.pepy.tech/badge/uv-version)](https://pepy.tech/project/uv-version)\n[![GitLab stars](https://img.shields.io/gitlab/stars/rocshers/python/uv-version)](https://gitlab.com/rocshers/python/uv-version)\n[![GitLab last commit](https://img.shields.io/gitlab/last-commit/rocshers/python/uv-version)](https://gitlab.com/rocshers/python/uv-version)\n\n## Functionality\n\n- Parsing: `git`, `pyproject.toml`, `env`, `stdin`\n- Output to: `pyproject.toml`, `stdout`\n- `Increment`\n\n## Quick start\n\n```bash\nuvx uv-version increment\n```\n\n## Configs\n\n## Commands\n\n### Arguments for using version\n\n- `--to-pyproject`: Set a new version in pyproject.toml. \\[Default\\]\n- `--to-print`: Print the new version to the console.\n\n### Arguments for getting version\n\n- `--from-pyproject`: Version is determined by the value in pyproject.toml project.version \\[Default\\]\n- `--from-git`: Version is determined based on the `git status`\n- `--from-stdin`: Version is expected as the last argument of the call or from stdin\n- `--from-env`: Version is expected in the environment variable `$PACKAGE_VERSION`.\n\nYou can use multiple attributes together.\n\nWhen retrieving the version from different sources, keep in mind that the **highest version will be used** in the end.\n\n### uvx increment\n\nIncreases the version by 1\n\n```bash\n$ uvx uv-version --to-print\n0.1.1\n$ uvx uv-version --to-print increment prerelease\n0.1.2a1\n$ uvx uv-version --to-print increment micro\n0.1.3\n$ uvx uv-version --to-print increment minor\n0.2.0\n$ uvx uv-version --to-print increment major\n1.0.0\n```\n\n## Use cases\n\n### Publishing python package to pypi via uv with version equal to git tag\n\n.gitlab-ci.yml:\n\n```yaml\npypi:\n  stage: publishing\n  image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim\n  tags:\n    - docker\n  script:\n    - apt install git\n    - uvx uv-version --from-git\n    - uv build --no-sources\n    - uv publish\n  rules:\n    - if: $CI_COMMIT_TAG\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n```\n\n- When creating a git tag: new package with version == {TAG}\n- When pushing to CI_DEFAULT_BRANCH: new package with version == {TAG}a{N}\n\n### Publishing python package to private pypi via uv with version equal to git tag and commit hash\n\n.gitlab-ci.yml:\n\n```yaml\npypi:\n  stage: publishing\n  image: ghcr.io/astral-sh/uv:python3.12-bookworm-slim\n  tags:\n    - docker\n  script:\n    - apt install git\n    # set alpha version template\n    - PACKAGE_VERSION_ALPHA_VERSION_FORMAT='{version}a{distance}+{commit_hash}'\n    # Update package version\n    - uvx uv-version --from-git\n    # Publishing to gitlab\n    - UV_PUBLISH_URL=https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/pypi\n    - UV_PUBLISH_TOKEN=${PYPI_TOKEN}\n    - uv build --no-sources\n    - uv publish\n  rules:\n    - if: $CI_COMMIT_TAG\n    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH\n```\n\n- When creating a git tag: new package with version == {TAG}\n- When pushing to CI_DEFAULT_BRANCH: new package with version == {TAG}a{N}+{COMMIT_HASH}\n\n## Roadmap\n\n- logging\n- tests\n- version construct\n- Set to `__init__`, `__version__`,`VERSION` files\n\n## Contribute\n\nIssue Tracker: <https://gitlab.com/rocshers/python/uv-version/-/issues>  \nSource Code: <https://gitlab.com/rocshers/python/uv-version>\n\nBefore adding changes:\n\n```bash\nmake install-dev\n```\n\nAfter changes:\n\n```bash\nmake format test\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI tool for managing package version",
    "version": "0.1.9.post1",
    "project_urls": null,
    "split_keywords": [
        "rocshers",
        " uvxt"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7da2b235a057967b46831549c2ec929c3af1bbd11e31d0920850d5ad2d16dca3",
                "md5": "430a147353a671912500cc9ec216d381",
                "sha256": "765b226941b23721ec88558092e4f333a7a27595a8207d2235a9aa57d18c9b8d"
            },
            "downloads": -1,
            "filename": "uv_version-0.1.9.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "430a147353a671912500cc9ec216d381",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9652,
            "upload_time": "2024-11-15T12:37:18",
            "upload_time_iso_8601": "2024-11-15T12:37:18.919973Z",
            "url": "https://files.pythonhosted.org/packages/7d/a2/b235a057967b46831549c2ec929c3af1bbd11e31d0920850d5ad2d16dca3/uv_version-0.1.9.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "69839ff7930a525be19a9000e6de650220570871a9aa21d188657793934b6eb1",
                "md5": "67b1548ee873bfca5d04a29e6859833e",
                "sha256": "b93afe3bd81a8fec8502c72b885b16cc9193359cc555b372c1e99a3d652a5722"
            },
            "downloads": -1,
            "filename": "uv_version-0.1.9.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "67b1548ee873bfca5d04a29e6859833e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9395,
            "upload_time": "2024-11-15T12:37:20",
            "upload_time_iso_8601": "2024-11-15T12:37:20.646815Z",
            "url": "https://files.pythonhosted.org/packages/69/83/9ff7930a525be19a9000e6de650220570871a9aa21d188657793934b6eb1/uv_version-0.1.9.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 12:37:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "uv-version"
}
        
Elapsed time: 0.47336s