Skip to content

Use cargo-shear for dependency checks in CI - #11476

Merged
Jefffrey merged 3 commits into
apache:mainfrom
sdf-jkl:codex/unused-dependencies-shear
Oct 15, 2026
Merged

Jefffrey merged 3 commits into
apache:mainfrom
sdf-jkl:codex/unused-dependencies-shear

Conversation

@sdf-jkl

@sdf-jkl sdf-jkl commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Which issue does this PR close?

closes #11166.

Rationale for this change

The existing unused-dependency checks add 54 Clippy invocations across Arrow crates and exclude tests and benchmarks. Replace them with cargo-shear to check dependencies across the repository, including dev-dependencies and Parquet crates.

The Machete comparison draft #11477 evaluates detection quality and false positives on the same upstream base. Dependencies remain unchanged so the PR CI runs show each tool's findings directly.

What changes are included in this PR?

  • Add a job using cargo-shear 1.14.0 with --deny-warnings, covering the workspace and both excluded PyArrow crates. The excluded-crate scans still run if an earlier scan finds issues.
  • Remove the 54 dependency-only Clippy invocations and preserve all 18 regular Clippy checks.
  • Use the same SHA-pinned checkout and tool installer actions as the existing workflows.
  • Change only the two workflow files. Findings fail the job without applying fixes or adding ignores; merge requirements are unchanged.

Are these changes tested?

actionlint, git diff --check, and typos --config typos.toml pass.

On upstream base e17d04788f, all three local Shear scans pass with no findings. Machete 0.9.2 reports six false positives on that same base: bytes, futures, and tokio in each of arrow-csv and arrow-json, all used in reader doctests.

The previously observed unused and misplaced dependencies have already been corrected upstream. This PR contains no dependency cleanup. The PR CI run will validate installation and execution in GitHub Actions.

Codex assisted with the workflow edits, local validation, and this description.

Are there any user-facing changes?

No. This changes CI only.

@Jefffrey Jefffrey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks i think we can go with shear

we can also remove occurrences of #[allow(unused_crate_dependencies)] i believe

and we can also remove it here:

# Dependency check excluding tests & benches. The crate declares no
# default features, so the --no-default-features variant arrow.yml
# also runs would be this same command.
cargo clippy -p arrow-pyarrow --all-features -- -D unused_crate_dependencies

Comment thread .github/workflows/rust.yml Resolved
Comment thread .github/workflows/rust.yml Resolved
@github-actions github-actions Bot added arrow-flight arrow-flight crate development-process Internal changes; PRs with this label are excluded from changelog arrow-core Core crates related to representing arrow data labels Oct 14, 2026
@sdf-jkl

sdf-jkl commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Thanks @Jefffrey. Addressed in 17d33d9

@Jefffrey
Jefffrey enabled auto-merge October 15, 2026 06:45
@Jefffrey

Copy link
Copy Markdown
Contributor

thanks @sdf-jkl

@Jefffrey
Jefffrey added this pull request to the merge queue Oct 15, 2026
Merged via the queue into apache:main with commit a743994 Oct 15, 2026
35 checks passed
@sdf-jkl
sdf-jkl deleted the codex/unused-dependencies-shear branch October 15, 2026 12:39
andygrove added a commit to andygrove/arrow-rs that referenced this pull request Nov 19, 2026
The `jiff` feature is expected to cover more than named timezones as
arrow moves to jiff, so the CI step names, the README and the feature
comments describe the feature rather than its current effect. The
`timezone` module docs keep the timezone details.

Remove `use chrono_tz as _`, which kept the
`-D unused_crate_dependencies` clippy checks passing. apache#11476 replaced
those checks with cargo-shear, which passes without it. Drop the
`tzdb_version` test, since the function only passes the release through.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data arrow-flight arrow-flight crate development-process Internal changes; PRs with this label are excluded from changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use cargo machete for unused dependencies check

2 participants