Skip to content

uv provider fails to update uv.lock when project name contains underscores #1754

@jharrisonSV

Description

@jharrisonSV

Description

The uv provider does not normalize package names when matching the project name from pyproject.toml against entries in uv.lock. When a project uses underscores in its name (e.g., my_package), uv normalizes this to hyphens in uv.lock (e.g., my-package). The uv provider performs a direct string comparison, so the match fails silently and uv.lock is not updated.

Steps to reproduce

  1. Create a project with an underscore in the name:
  # pyproject.toml
  [project]
  name = "my_package"

  [tool.commitizen]
  version_provider = "uv"
  1. Run uv lock — the lockfile will contain name = "my-package"
  2. Create initial commit and run cz bump
  3. Observe that pyproject.toml is updated but uv.lock still has the old version

Current behavior

On cz bump, pyproject.toml is updated but uv.lock still has the old version.

Desired behavior

Both pyproject.toml and uv.lock should be updated.

Screenshots

No response

Environment

Commitizen Version: 4.11.0
Python Version: 3.14.2 (main, Dec 5 2025, 16:49:16) [Clang 17.0.0 (clang-1700.4.4.1)]
Operating System: Darwin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions