You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config/version_provider.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,40 @@ name = "my-package"
96
96
version = "0.1.0"# Managed by Commitizen
97
97
```
98
98
99
+
### `pep751`
100
+
101
+
Manages version in `pyproject.toml` (`project.version`) and updates the project's own entry in [PEP 751](https://peps.python.org/pep-0751/)`pylock.toml` lock files. Only updates `[[packages]]` entries that reference the project as a local directory source (`[packages.directory]`), since those are the only entries safe to edit without invalidating hashes and URLs.
102
+
103
+
!!! note
104
+
`pylock.toml` is a standardized Python lock file format (PEP 751). Unlike `package-lock.json` or `uv.lock`, it has no root-level project version — the project may appear as a `[[packages]]` entry with a `[packages.directory]` source. This provider handles that case automatically. If your project doesn't appear in its own lock file (the common case), it behaves identically to `pep621`.
105
+
106
+
**Use when:**
107
+
108
+
- You're using a PEP 751-compliant lock tool and have `pylock.toml` files
109
+
- You want version synchronization between `pyproject.toml` and `pylock.toml`
110
+
111
+
**Configuration:**
112
+
```toml
113
+
[tool.commitizen]
114
+
version_provider = "pep751"
115
+
```
116
+
117
+
**Example `pylock.toml` entry that gets updated:**
118
+
```toml
119
+
lock-version = "1.0"
120
+
created-by = "uv"
121
+
122
+
[[packages]]
123
+
name = "my-package"
124
+
version = "0.1.0"# Updated by Commitizen
125
+
126
+
[packages.directory]
127
+
path = "."
128
+
editable = true
129
+
```
130
+
131
+
Also handles named lock files like `pylock.dev.toml`, `pylock.prod.toml`, etc.
132
+
99
133
### `uv`
100
134
101
135
Manages version in both `pyproject.toml` (`project.version`) and `uv.lock` (`package.version` for the matching package name). This ensures consistency between your project metadata and lock file.
@@ -190,6 +224,7 @@ version_provider = "composer"
190
224
|`commitizen`| Commitizen config file | No | General use, flexible projects |
0 commit comments