Skip to content

chore: remove unused Cargo dependencies - #6732

Merged
Xuanwo merged 1 commit into
mainfrom
cleanup-unused-dependencies
May 13, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
cleanup-unused-dependencies

Conversation

@Xuanwo

@Xuanwo Xuanwo commented May 11, 2026

Copy link
Copy Markdown
Member

This cleans up direct Cargo dependency declarations that are no longer referenced across the Rust workspace and the Python/JNI crates.

The generated-code and macro-only dependencies that still need to be declared are kept explicitly ignored for cargo-machete so future scans do not remove required dependencies.

@github-actions github-actions Bot added A-python Python bindings A-java Java bindings + JNI labels May 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@Xuanwo Xuanwo changed the title Remove unused Cargo dependencies chore: remove unused Cargo dependencies May 11, 2026
@github-actions github-actions Bot added the chore label May 11, 2026
@Xuanwo
Xuanwo force-pushed the cleanup-unused-dependencies branch from 8be0317 to 2eb0f8c Compare May 11, 2026 16:56
@Xuanwo
Xuanwo marked this pull request as ready for review May 11, 2026 17:04

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@Xuanwo

Xuanwo commented May 11, 2026

Copy link
Copy Markdown
Member Author

@claude review once

Comment thread Cargo.toml Outdated
Comment on lines 70 to 71
lance-namespace-impls = { version = "=7.0.0-beta.7", path = "./rust/lance-namespace-impls" }
lance-namespace-datafusion = { version = "=7.0.0-beta.7", path = "./rust/lance-namespace-datafusion" }
lance-namespace-reqwest-client = "0.7.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Removing lance-namespace-datafusion from [workspace.dependencies] in Cargo.toml leaves the matching [[tool.bumpversion.files]] entry in .bumpversion.toml (lines 93-96) orphaned. Since the top-level [tool.bumpversion] sets ignore_missing_version = false, the next release run will fail with VersionNotFoundError. Fix by deleting the orphaned bumpversion entry (the per-crate rust/lance-namespace-datafusion/Cargo.toml uses version.workspace = true, so no replacement entry is needed) or by restoring the workspace dep line.

Extended reasoning...

What the bug is

This PR removes the workspace-level dependency declaration for lance-namespace-datafusion from the root Cargo.toml:

-lance-namespace-datafusion = { version = "=7.0.0-beta.7", path = "./rust/lance-namespace-datafusion" }

However .bumpversion.toml still contains a per-substring substitution rule that targets exactly that line (lines 93-96):

[[tool.bumpversion.files]]
filename = "Cargo.toml"
search = 'lance-namespace-datafusion = {{ version = "={current_version}"'
replace = 'lance-namespace-datafusion = {{ version = "={new_version}"'

Why this breaks release automation

The top-level [tool.bumpversion] block (line 12) explicitly sets:

ignore_missing_version = false

bump-my-version raises VersionNotFoundError when a configured search pattern cannot be found in its target file and ignore_missing_version is false. After this PR the substring lance-namespace-datafusion = { version = "=7.0.0-beta.7" no longer appears anywhere in the root Cargo.toml, so the very next release version bump will abort.

Step-by-step proof

  1. Apply this PR. The root Cargo.toml now jumps from lance-namespace-impls straight to lance-namespace-reqwest-client (no lance-namespace-datafusion workspace dep).
  2. A release engineer runs bump-my-version bump minor (or whatever component) at the repo root.
  3. bump-my-version iterates over each [[tool.bumpversion.files]] entry. When it reaches the entry on lines 93-96, it tries to find the substring lance-namespace-datafusion = { version = "=7.0.0-beta.7" in Cargo.toml.
  4. The substring is absent. Because ignore_missing_version = false is set globally and not overridden on this entry, the tool raises VersionNotFoundError and aborts the bump.
  5. Release is blocked until someone edits .bumpversion.toml.

Why existing config doesn't prevent it

Each [[tool.bumpversion.files]] entry inherits the top-level ignore_missing_version unless it overrides it; this entry does not override. No CI step in this PR validates .bumpversion.toml against the current Cargo.toml, so the failure only surfaces at release time.

Scope confirmation

The other workspace dep removed by this PR (lance-arrow-stats) has no corresponding bumpversion entry — .bumpversion.toml only configures rules for crates whose version equals current_version (7.0.0-beta.7), and lance-arrow-stats uses 58.0.0. So lance-namespace-datafusion is the only orphaned rule.

The crate rust/lance-namespace-datafusion itself remains a workspace member (still listed in [workspace] members) and its own Cargo.toml uses version.workspace = true, so no per-crate bumpversion rule is required as a replacement.

How to fix

Delete the orphaned [[tool.bumpversion.files]] block at .bumpversion.toml lines 93-96, or restore the workspace dep line in Cargo.toml if removing it was unintentional.

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Xuanwo
Xuanwo force-pushed the cleanup-unused-dependencies branch from 2eb0f8c to 7a0bbe9 Compare May 12, 2026 06:13
@Xuanwo
Xuanwo force-pushed the cleanup-unused-dependencies branch from 7a0bbe9 to b5350fa Compare May 13, 2026 08:46
@Xuanwo
Xuanwo merged commit 7d5a08e into main May 13, 2026
28 checks passed
@Xuanwo
Xuanwo deleted the cleanup-unused-dependencies branch May 13, 2026 11:24
wjones127 added a commit that referenced this pull request May 28, 2026
Switch the release publish step from `albertlockett/publish-crates` to
`cargo publish --workspace`, which was stabilized in Rust 1.90 and
supports `--exclude` natively.

Exclude `lance-arrow-stats` and `lance-arrow-scalar` from the
per-release publish since they are versioned to track Arrow's major
(currently 58.0.0) and released on Arrow's cadence, not Lance's. The
previous action aborted the entire run whenever either crate's source
changed without a version bump, which is what blocked the v7.0.0 Rust
publish (#6732 removed a stale `half` dep from `arrow-stats` after
`58.0.0` was published).

The `skip_check_repo` workflow_dispatch input is removed since it only
configured the previous action.

Followup: bump `lance-arrow-stats` to `58.0.1` so its crates.io source
matches the workspace tree again, then drop the corresponding
`--exclude` from this workflow.

Fixes #6971

## Test plan
- [ ] Dispatch `cargo-publish.yml` with `tag: v7.0.0` once this lands;
verify all non-excluded workspace crates publish to crates.io

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-java Java bindings + JNI A-python Python bindings chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants