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

Remove clap Dependency From Library #737

Open
theduke opened this issue Mar 9, 2021 · 7 comments · May be fixed by #1203
Open

Remove clap Dependency From Library #737

theduke opened this issue Mar 9, 2021 · 7 comments · May be fixed by #1203

Comments

@theduke
Copy link
Contributor

theduke commented Mar 9, 2021

When using tokei as a library, you still get clap as a dependency.

Would be great to only use clap in the binary.

@XAMPPRocky
Copy link
Owner

XAMPPRocky commented Mar 9, 2021

Thank you for your issue! However I'm afraid, there's not much that I can do. This more an issue with cargo. See this issue for more information, I could probably restructure the project to remove the dependency from the library, however I'm not really sure it's worth it in terms of time or effort, have you noticed a meaningful compile time improvement if not compiled with clap?

@vks
Copy link

vks commented Apr 25, 2021

Making clap an optional dependency might work, too.

Alternatively, the binary and the library could be split into separate packages.

@brightly-salty
Copy link
Contributor

I'd be willing to attempt restructuring the project into separate packages and submit a PR if @XAMPPRocky is okay with it.

@XAMPPRocky
Copy link
Owner

Hmm, right now I still don't really the value in splitting the project up, I would think the energy would be better spent trying to push for [bin-dependencies] or similar in Cargo.

@nicolacSNPS
Copy link

Without restructuring the project, maybe defining the clap dependency as optional and being guarded by a "cli" feature that is enabled by default?

Like this when I import tokei I can disable most features and get rid of these unnecessary dependencies like clap?

@vks
Copy link

vks commented Sep 10, 2021

Like this when I import tokei I can disable most features and get rid of these unnecessary dependencies like clap?

This should work, but I think you will have to use the new resolver for that.

@nicolacSNPS
Copy link

Like this when I import tokei I can disable most features and get rid of these unnecessary dependencies like clap?

This should work, but I think you will have to use the new resolver for that.

I am, and its becoming default in the next edition coming very soon :)

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 a pull request may close this issue.

5 participants