Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c0ca27d
fix: workspace member with fixed version key
vemilano Jun 15, 2026
9277972
feat: inheriting workspace members with path, package and version att…
vemilano Jun 19, 2026
8600f81
ci(docspublish): make cli_interactive gif regeneration deterministic …
bearomorphism Jun 21, 2026
8bd1417
ci: make bump preview comment sticky (#2008)
bearomorphism Jun 21, 2026
2394ddb
ci(deps): bump codecov/codecov-action from 6 to 7 (#2013)
dependabot[bot] Jun 21, 2026
2b37564
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Jun 21, 2026
de8a33d
ci(deps): bump peter-evans/find-comment from 3 to 4 (#2020)
dependabot[bot] Jun 22, 2026
5b49851
fix(providers/cargo): don't crash on workspace member with fixed version
bearomorphism May 25, 2026
8e6c95a
bump: version 4.16.3 → 4.16.4
commitizenbot[bot] Jun 22, 2026
1b133ac
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Jun 22, 2026
ee4554d
build(deps): update argcomplete requirement from <3.7,>=1.12.1 to >=1…
dependabot[bot] Jul 1, 2026
6da74da
ci(deps): bump dawidd6/action-homebrew-bump-formula from 7 to 8 (#2022)
dependabot[bot] Jul 3, 2026
93a05d4
ci(deps): bump soupsieve from 2.8.3 to 2.8.4 (#2024)
dependabot[bot] Jul 10, 2026
427b1dc
fix: exclude star-history API from lychee link checker (#2029)
Copilot Jul 16, 2026
84480c3
bump: version 4.16.4 → 4.16.5
commitizenbot[bot] Jul 16, 2026
fa98440
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Jul 16, 2026
fb8b249
ci(deps): bump actions/setup-go from 6 to 7 (#2032)
dependabot[bot] Jul 17, 2026
73dbe61
ci(deps): bump actions/labeler from 6 to 7 (#2034)
dependabot[bot] Jul 22, 2026
c985d57
ci(deps): bump gitpython from 3.1.50 to 3.1.52 (#2035)
dependabot[bot] Jul 22, 2026
5b291b4
ci(deps): bump pymdown-extensions from 10.21.3 to 11.0 (#2037)
dependabot[bot] Jul 28, 2026
617dd0f
ci(deps): bump gitpython from 3.1.52 to 3.1.54 (#2038)
dependabot[bot] Jul 28, 2026
e72bfd0
build(deps-dev): update uv-build requirement from <0.12,>=0.9.17 to >…
dependabot[bot] Jul 29, 2026
a4e410d
fix(bump): use correct type for calling changelog
woile Jul 24, 2026
0c0751a
fix(version): remove next from exclusive group
woile Jul 24, 2026
50f0dcb
fix: robuster agents
woile Jul 24, 2026
7586ec3
feat(cmd/version): add support for `--next USE_GIT_COMMITS`
woile Jul 24, 2026
b4fd8a3
bump: version 4.16.5 → 4.17.0
commitizenbot[bot] Jul 29, 2026
4c3bd92
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Jul 29, 2026
5529ed4
docs: remove star history (#2043)
bearomorphism Jul 29, 2026
51ab90c
docs(tutorial): add Releasing with the SCM Version Provider
woile Jul 29, 2026
3490872
build(deps): bump gitpython from 3.1.54 to 3.1.57 (#2050)
dependabot[bot] Aug 5, 2026
44234a0
build(deps): bump gitpython from 3.1.57 to 3.1.58 (#2058)
dependabot[bot] Aug 10, 2026
85ac073
build(deps): bump pymdown-extensions from 11.0 to 11.0.1 (#2059)
dependabot[bot] Aug 10, 2026
b3b009f
fix(init): use prek when installing hooks if pre-commit is missing
DSeaStar Aug 14, 2026
6931803
fix(init): skip hook question when no installer is present
DSeaStar Aug 14, 2026
0c73c4e
test(init): cover installer missing at install time
DSeaStar Aug 14, 2026
b0f522f
bump: version 4.17.0 → 4.17.1
commitizenbot[bot] Aug 17, 2026
9351e01
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Aug 17, 2026
4ce8164
feat(commit): add a tag(--body-length-limit) and a function for comma…
yjaw Aug 19, 2026
cc45233
bump: version 4.17.1 → 4.18.0
commitizenbot[bot] Aug 19, 2026
6e013c1
docs(cli/screenshots): update CLI screenshots
github-actions[bot] Aug 19, 2026
16117a8
docs(tutorial): fix setup-cz link
bearomorphism Aug 20, 2026
196973f
docs: restore Star History section in README (#2054)
Mubelotix Aug 20, 2026
0bc70e8
ci: restore changelog updates (#2074)
bearomorphism Aug 20, 2026
d5c90a1
ci(links): avoid duplicate broken link reports (#2073)
bearomorphism Aug 21, 2026
7efe21a
fix: workspace member with fixed version key
vemilano Jun 15, 2026
45945bf
feat: inheriting workspace members with path, package and version att…
vemilano Jun 19, 2026
b6da25f
refactor: uv run poe all
vemilano Aug 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: uv run poe all
  • Loading branch information
vemilano committed Aug 24, 2026
commit b6da25fdfc145ced8fce06f3871bf8dff6542178
28 changes: 16 additions & 12 deletions commitizen/providers/cargo_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ def get(self, document: TOMLDocument) -> str:
def set(self, document: TOMLDocument, version: str) -> None:
_try_get_workspace(document)["package"]["version"] = version

if document.get("workspace"):
if document.get("workspace") and isinstance(document["workspace"], dict):
# get all workspace members that have a version.workspace = true
members_inheriting = _get_workspace_members(document, self._get_encoding())

# get all workspace dependencies that have a version specified and match a member inheriting
workspace_deps = document["workspace"].get("dependencies", {})
for dep_name, dep_value in workspace_deps.items():
if isinstance(dep_value, str) and (dep_name in members_inheriting):
if isinstance(dep_value, str) and (dep_name in members_inheriting):
workspace_deps[dep_name] = version
elif (isinstance(dep_value, dict) and dep_value.get("version", [])):
elif isinstance(dep_value, dict) and dep_value.get("version", []):
if dep_value.get("path", "") and dep_value.get("package", ""):
crate_name = dep_value["package"]
else:
Expand Down Expand Up @@ -79,7 +79,9 @@ def set_lock_version(self, version: str) -> None:
cargo_lock_content["package"][i]["version"] = version # type: ignore[index]
break
except NonExistentKey:
members_inheriting = _get_workspace_members(cargo_toml_content, self._get_encoding())
members_inheriting = _get_workspace_members(
cargo_toml_content, self._get_encoding()
)

for i, package in enumerate(packages):
if package["name"] in members_inheriting:
Expand All @@ -99,7 +101,10 @@ def _try_get_workspace(document: TOMLDocument) -> dict:
except NonExistentKey:
return document

def _get_workspace_members(cargo_toml_content: TOMLDocument, encoding: str | None) -> list[str]:

def _get_workspace_members(
cargo_toml_content: TOMLDocument, encoding: str | None
) -> list[str]:
workspace = cargo_toml_content.get("workspace", {})
if TYPE_CHECKING:
assert isinstance(workspace, dict)
Expand All @@ -110,15 +115,14 @@ def _get_workspace_members(cargo_toml_content: TOMLDocument, encoding: str | Non
for member in workspace_members:
for path in glob.glob(member, recursive=True):
if any(
fnmatch.fnmatch(path, pattern)
for pattern in excluded_workspace_members
fnmatch.fnmatch(path, pattern) for pattern in excluded_workspace_members
):
continue

cargo_file = Path(path) / "Cargo.toml"
package_content = parse(
cargo_file.read_text(encoding=encoding)
).get("package", {})
package_content = parse(cargo_file.read_text(encoding=encoding)).get(
"package", {}
)
if TYPE_CHECKING:
assert isinstance(package_content, dict)
try:
Expand All @@ -131,5 +135,5 @@ def _get_workspace_members(cargo_toml_content: TOMLDocument, encoding: str | Non
members_inheriting.append(package_name)
except NonExistentKey:
pass
return members_inheriting

return members_inheriting
2 changes: 2 additions & 0 deletions tests/providers/test_cargo_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ def test_cargo_provider_inheriting_workspace_member_with_version_in_toml(
assert file.read_text() == dedent(expected_workspace_toml)
assert lock_file.read_text() == dedent(expected_lock_content)


def test_cargo_provider_inheriting_workspace_member_with_version_dict_in_toml(
config: BaseConfig,
chdir: Path,
Expand Down Expand Up @@ -672,6 +673,7 @@ def test_cargo_provider_inheriting_workspace_member_with_version_dict_in_toml(
assert file.read_text() == dedent(expected_workspace_toml)
assert lock_file.read_text() == dedent(expected_lock_content)


def test_cargo_provider_inheriting_workspace_member_with_version_and_package_in_toml(
config: BaseConfig,
chdir: Path,
Expand Down