Skip to content

Add version for path-only dependencies - #380

Closed
davide125 wants to merge 1 commit into
rust-cli:mainfrom
davide125:version
Closed

davide125 wants to merge 1 commit into
rust-cli:mainfrom
davide125:version

Conversation

@davide125

Copy link
Copy Markdown

What does this PR try to solve?

This makes it possible to run cargo test on the published crates without errors.

Notes to reviewers

Ran a build and the tests.

LLM involvement: none

This makes it possible to run `cargo test` on the published crates
without errors.
@epage

epage commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Note that we don't publish integration tests, limiting the benefits of running tests on published packages, see

anstyle/Cargo.toml

Lines 10 to 18 in 88429fc

include = [
"/build.rs",
"/src/**/*",
"/Cargo.toml",
"/Cargo.lock",
"/LICENSE*",
"/README.md",
"/examples/**/*"
]

This also can't always be done as dropping the version is an expected workaround by the Cargo team for avoiding some types of dependency cycles that prevent publishing. This has been codified in cargo add which always leaves out versions when doing cargo add --dev.

So I'm leaning towards "why bother".

(note: we have a general policy that issues should be opened before PRs and call out that people underestimate the need for an issue and this is an example of where this all really should be discussed on an issue and not a PR)

@davide125

Copy link
Copy Markdown
Author

Thanks! This came up as I was packaging colorchoice-clap for Fedora. We always try to run tests at package builds, and that's what surfaced it. We generally try to submit fixes like this upstream, but I totally understand if you'd rather not have it, in that case I can just keep patching the version on my end.

@epage epage closed this Dec 4, 2026
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.

2 participants