{{ message }}
Fix/cargo workspace deps version for publishing - #2017
Open
vemilano wants to merge 48 commits into
Open
Conversation
Lee-W
force-pushed
the
fix/cargo-workspace-deps-version
branch
from
June 19, 2026 13:56
bba3019 to
9277972
Compare
…ommitizen-tools#2009) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When iterating workspace members in `CargoProvider.set_lock_version`, the code subscripted `package["version"]["workspace"]` inside a try/except block that only caught `NonExistentKey`. If a member's `Cargo.toml` declared a hardcoded version (`version = "x.y.z"`) instead of `version.workspace = true`, `package["version"]` was a tomlkit `String` and the subscript raised `TypeError: string indices must be integers, not 'str'`, which was not caught and propagated as a crash. Replace the exception-driven check with an `isinstance` type guard so the inheritance lookup only runs when `version` is an actual table. Fixes commitizen-tools#2001 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….12.1,<3.8 (commitizen-tools#2021) Signed-off-by: dependabot[bot] <support@github.com>
…itizen-tools#2022) Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…ols#2029) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…ols#2037) Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
…=0.9.17,<0.13 (commitizen-tools#2039) Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tim Hsiung <26526132+bearomorphism@users.noreply.github.com>
…tools#2059) Signed-off-by: dependabot[bot] <support@github.com>
cz init already treated prek as installed, but always ran `pre-commit install`, which raised FileNotFoundError when only prek was on PATH. Use the available installer, and ask when both exist. Fixes commitizen-tools#2018
If neither pre-commit nor prek is on PATH, skip the hook-type question instead of failing init. Users who want hooks can install a tool and retry.
The InitFailedError branch in _ask_hook_installer was flagged by codecov as the only uncovered line of the PR. Add a test where the installer is available during the hook-type question but disappears before the install step, so the guard is exercised instead of removed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* ci: restore changelog updates Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * ci: configure changelog updates on bump Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This PR makes 2 things:
Regarding the second point, to provide more details, crates.io requires that each crate have a version specified in Cargo.toml. For projects that use a workspace, this means that all members using
version.workspace = truemust also have a version specified at theworkspace.dependencieslevel (the specified version must be the same as that ofworkspace.version).When performing a version bump, in addition to updating
workspace.version(in Cargo.toml) and the versions in Cargo.lock, we must also update the versions specified in Cargo.toml, since they are actually dynamically managed by Cargo viaversion.workspace = true.Projects such as
crate-ci/cargo-releaseorpksunkara/cargo-workspacesalso use the same processChecklist
Was generative AI tooling used to co-author this PR?
no
Code Changes
uv run poe alllocally to ensure this change passes linter check and tests