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

Example workspace inheritance port #3719

Closed

Conversation

Muscraft
Copy link

This is a draft PR to represent what it would look like to port an existing project to using {key}.workspace = true in its workspace members.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
clap_complete_fig/Cargo.toml Outdated Show resolved Hide resolved
clap_derive/Cargo.toml Outdated Show resolved Hide resolved
clap_mangen/Cargo.toml Outdated Show resolved Hide resolved
clap_lex/Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
clap = { path = ".", version = "3.1.10", default-features = false, features = ["std"] }
clap_derive = { path = "./clap_derive", version = "=3.1.18" }
clap_lex = { path = "./clap_lex", version = "0.2.0" }
os_str_bytes = { version = "6.0", default-features = false, features = ["raw_os_str"] }
Copy link
Member

@epage epage May 10, 2022

Choose a reason for hiding this comment

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

FYI os_str_bytes is needed to be shared because its a public dependency of clap_lex though clap_lex re-exports parts of it, so maybe we could pull this from clap depending on it?

Comment on lines +32 to +30
shlex = "1.1.0"
snapbox = "0.2.9"
trycmd = { version = "0.13", default-features = false, features = ["color-auto", "diff", "examples"] }
Copy link
Member

Choose a reason for hiding this comment

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

FYI these are shared to reduce duplicate dependencies

@@ -7,32 +9,39 @@ members = [
"clap_mangen",
]

[workspace.package]
categories = ["command-line-interface"]
edition = "2018"
Copy link
Member

Choose a reason for hiding this comment

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

FYI While there are cases where people might want different editions in a workspace, I think its a good idea to generally consolidate and share it. Similar for rust- version.

@epage
Copy link
Member

epage commented May 10, 2022

Thanks!

@Muscraft Muscraft force-pushed the example-workspace-inheritance branch from 11664f7 to 3e99c5e Compare May 11, 2022 01:27
"LICENSE-*",
"README.md"
]
version.workspace = true
Copy link
Member

Choose a reason for hiding this comment

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

FYI Before, we only could enforce clap and clap_derive shared a version via cargo-release but now we can do it here.

Comment on lines -5 to -10
include = [
"src/**/*",
"Cargo.toml",
"LICENSE-*",
"README.md"
]
Copy link
Member

Choose a reason for hiding this comment

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

FYI Our includes are meant to be the same but have diverged over time. Now we'll be able to keep them the same!

@Muscraft Muscraft force-pushed the example-workspace-inheritance branch from 3e99c5e to 7eb5456 Compare May 11, 2022 02:46
@@ -39,7 +36,7 @@ roff = "0.2.1"
clap = { path = "../", version = "3.1.10", default-features = false, features = ["std", "env"] }

[dev-dependencies]
snapbox = { version = "0.2", features = ["diff"] }
snapbox = { workspace = true, features = ["diff"] }
Copy link
Member

Choose a reason for hiding this comment

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

How come diff isn't in the workspace?

Copy link
Author

Choose a reason for hiding this comment

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

Not every user of snapbox needs diff so I left it only in this spot

Copy link
Member

Choose a reason for hiding this comment

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

Thats a bug. diff improves the output of snapbox and we always want it.

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.

None yet

2 participants