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

Include crate version for dev-dependencies #2614

Closed

Conversation

j-vanderstoep
Copy link

@j-vanderstoep j-vanderstoep commented Jun 21, 2022

This ensures that test dependencies are included in the Cargo.toml
that is published to crates.io.

As noted in the Cargo book:
When a package is published, only dev-dependencies that specify a
version will be included in the published crate. For most use cases,
dev-dependencies are not needed when published, though some users
(like OS packagers) may want to run tests within a crate, so
providing a version if possible can still be beneficial.

This is helpful for running tests in the Android Open Source Project,
which uses crates.io as its source of truth, and prevents having to
carry local patches.

Test: cargo publish --dry-run
Confirm that dev-dependencies are listed in the resulting
Cargo.toml.

This ensures that test dependencies are included in the Cargo.toml
that is published to crates.io.

As noted in the Cargo book:
When a package is published, only dev-dependencies that specify a
version will be included in the published crate. For most use cases,
dev-dependencies are not needed when published, though some users
(like OS packagers) may want to run tests within a crate, so
providing a version if possible can still be beneficial.

This is helpful for running tests in the Android Open Source Project,
which uses crates.io as its source of truth, and prevents having to
carry local patches.

Test: cargo publish --dry-run
Confirm that dev-dependencies are not listed in the resulting
Cargo.toml.
@j-vanderstoep j-vanderstoep requested a review from taiki-e as a code owner June 21, 2022 19:02
@taiki-e
Copy link
Member

taiki-e commented Jun 22, 2022

Thanks for the PR. This is intentional (#2305), and cannot be accepted unless rust-lang/cargo#4242 is fixed.

@taiki-e taiki-e closed this Jun 22, 2022
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.

3 participants