Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cargo-udeps in CI #3646

Merged
merged 8 commits into from
Mar 22, 2023
Merged

Conversation

JonathanPlasse
Copy link
Contributor

@JonathanPlasse JonathanPlasse commented Mar 21, 2023

@JonathanPlasse JonathanPlasse force-pushed the add-cargo-udeps-in-ci branch from 71d1901 to ccb1493 Compare March 21, 2023 13:12
@github-actions
Copy link
Contributor

github-actions bot commented Mar 21, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

Benchmark

Linux

group                                      main                                    pr
-----                                      ----                                    --
linter/all-rules/large/dataset.py          1.03     16.8±0.08ms     2.4 MB/sec     1.00     16.4±0.08ms     2.5 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.3±0.02ms     3.9 MB/sec     1.00      4.3±0.01ms     3.9 MB/sec
linter/all-rules/numpy/globals.py          1.00    587.9±1.26µs     5.0 MB/sec     1.01    590.9±2.12µs     5.0 MB/sec
linter/all-rules/pydantic/types.py         1.02      7.4±0.05ms     3.5 MB/sec     1.00      7.2±0.06ms     3.5 MB/sec
linter/default-rules/large/dataset.py      1.01      8.8±0.03ms     4.6 MB/sec     1.00      8.7±0.02ms     4.7 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.01  1974.1±117.34µs     8.4 MB/sec    1.00   1954.8±2.42µs     8.5 MB/sec
linter/default-rules/numpy/globals.py      1.00    213.6±0.52µs    13.8 MB/sec     1.03    219.4±0.68µs    13.5 MB/sec
linter/default-rules/pydantic/types.py     1.00      4.1±0.01ms     6.2 MB/sec     1.00      4.1±0.01ms     6.2 MB/sec

Windows

group                                      main                                   pr
-----                                      ----                                   --
linter/all-rules/large/dataset.py          1.06     17.9±0.88ms     2.3 MB/sec    1.00     16.9±0.56ms     2.4 MB/sec
linter/all-rules/numpy/ctypeslib.py        1.01      4.7±0.28ms     3.5 MB/sec    1.00      4.7±0.22ms     3.5 MB/sec
linter/all-rules/numpy/globals.py          1.05   644.9±38.36µs     4.6 MB/sec    1.00   612.5±37.68µs     4.8 MB/sec
linter/all-rules/pydantic/types.py         1.04      7.9±0.34ms     3.2 MB/sec    1.00      7.6±0.38ms     3.4 MB/sec
linter/default-rules/large/dataset.py      1.02      9.8±0.46ms     4.1 MB/sec    1.00      9.6±0.48ms     4.2 MB/sec
linter/default-rules/numpy/ctypeslib.py    1.03      2.1±0.09ms     7.8 MB/sec    1.00      2.1±0.11ms     8.0 MB/sec
linter/default-rules/numpy/globals.py      1.02   243.6±19.81µs    12.1 MB/sec    1.00   238.3±18.62µs    12.4 MB/sec
linter/default-rules/pydantic/types.py     1.01      4.5±0.17ms     5.7 MB/sec    1.00      4.4±0.23ms     5.7 MB/sec

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Oh wow... I didn't expect this to be picked up and be implemented so quickly! Thank you.

Can you add a test plan to your PR summary that shows that the job fails if there's an unused dependency (you can push a change to this PR and then add a link to the action-run to PR summary).

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@JonathanPlasse JonathanPlasse marked this pull request as draft March 21, 2023 17:05
@JonathanPlasse JonathanPlasse force-pushed the add-cargo-udeps-in-ci branch from 23ec957 to ad011c5 Compare March 21, 2023 18:15
@JonathanPlasse
Copy link
Contributor Author

Successful cargo-udeps CI

No unused dependencies found

Failed cargo-udeps CI

Unused dependencies found

`ruff_diagnostics v0.0.0 (/home/runner/work/ruff/ruff/crates/ruff_diagnostics)`
└─── dependencies
     └─── "clap"
`ruff_formatter v0.0.0 (/home/runner/work/ruff/ruff/crates/ruff_formatter)`
└─── dev-dependencies
     └─── "insta"
`ruff_python_formatter v0.0.0 (/home/runner/work/ruff/ruff/crates/ruff_python_formatter)`
└─── dev-dependencies
     └─── "test-case"
`ruff_wasm v0.0.0 (/home/runner/work/ruff/ruff/crates/ruff_wasm)`
└─── dev-dependencies
     └─── "wasm-bindgen-test"
Note: They might be false-positive.
      For example, `cargo-udeps` cannot detect usage of crates that are only used in doc-tests.
      To ignore some dependencies, write `package.metadata.cargo-udeps.ignore` in Cargo.toml.

@JonathanPlasse JonathanPlasse marked this pull request as ready for review March 21, 2023 19:11
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Nice polished summary! I'm unsure about adding the PR result to the comment action because of the added complexity, and that I don't think it is necessary. My inline comment goes into details why. What was your motivation when you added it?

.github/workflows/pr-comment.yaml Outdated Show resolved Hide resolved
.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@JonathanPlasse JonathanPlasse force-pushed the add-cargo-udeps-in-ci branch from 0a38b44 to bc4a9f4 Compare March 22, 2023 08:33
@JonathanPlasse
Copy link
Contributor Author

Nice polished summary! I'm unsure about adding the PR result to the comment action because of the added complexity, and that I don't think it is necessary. My inline comment goes into details why. What was your motivation when you added it?

It was to make the cargo-udeps summary more visible.
But, as you said, it would cause noise and it should not happen very often.

@MichaReiser MichaReiser merged commit 3ec1ea8 into astral-sh:main Mar 22, 2023
@JonathanPlasse JonathanPlasse deleted the add-cargo-udeps-in-ci branch March 22, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: Add CI step to check for unused dependencies
2 participants