Skip to content

uv version --bump ... drops comments just before the version #16133

@khneal

Description

@khneal

Summary

I noticed that using uv version --bump ... will drop any comments in pyproject.toml on lines immediately preceding the "version = ..." line.

For example, running uv version --bump patch with this pyproject.toml:

# hello
[project]
# hello
name = "hello-world"
# hello
version = "0.1.0"
# hello
description = "Add your description here"
# hello
readme = "README.md"
# hello
requires-python = ">=3.13"
# hello
dependencies = []
# hello

Will result in this:

# hello
[project]
# hello
name = "hello-world"
version = "0.1.1"
# hello
description = "Add your description here"
# hello
readme = "README.md"
# hello
requires-python = ">=3.13"
# hello
dependencies = []
# hello

Platform

macOS 15 arm64

Version

uv 0.8.22 (Homebrew 2025-09-23)

Python version

Python 3.13.7 (main, Sep 18 2025, 22:52:34) [Clang 20.1.4 ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions