textplots-rs icon indicating copy to clipboard operation
textplots-rs copied to clipboard

lib-version only without structopt dependency

Open dvtomas opened this issue 3 years ago • 9 comments

I'm using textplots as a lightweight lib only. Would it be possible to either split it into two crates, or use features, to have a structopt and meval dependencies free build?

dvtomas avatar Sep 21 '21 04:09 dvtomas

Hello, anybody has an opinion on this?

dvtomas avatar Oct 08 '21 09:10 dvtomas

Useful links:

https://stackoverflow.com/a/47113822

https://github.com/rust-lang/cargo/issues/1982

dvtomas avatar Oct 14 '21 08:10 dvtomas

Makes sense to me. structopt and meval is only used in the binary CLI so I think it might be able to be moved to [dev-dependencies]. should be easy

TDHolmes avatar Jan 05 '22 04:01 TDHolmes

ah sorry, no it can't, but yeah it could be split into a feature and the CLI bin could be set to require that feature.

TDHolmes avatar Jan 05 '22 04:01 TDHolmes

There's a discussion on how to do that in the "useful links" mentioned above.

dvtomas avatar Jan 05 '22 07:01 dvtomas

/cc @micouy

Any thoughts on this yet? IMHO it would be the best and easiest to just make the CLI another example. I'm willing to do a PR if you agree.

dvtomas avatar Jan 18 '22 10:01 dvtomas

??

dvtomas avatar Feb 10 '22 09:02 dvtomas

I agree, I just hit this myself causing a duplicate dependency of a different version when I'm just using it as a library. I lean slightly towards the optional dependency or separate crate fix myself though.

TDHolmes avatar Jul 02 '22 03:07 TDHolmes

yep, would be great to have those options. Unfortunately, the crate becomes unusable in some cases. Allowing those things to be optionally enabled as features or as separate dependency would solve the issue.

ttytm avatar Oct 01 '22 22:10 ttytm

meval seems to be unmaintained, and it depends on nom = ^1.0.0, which will become rejected in a future version of rust (https://github.com/rust-lang/rust/issues/79813). The possible fixes for this upcoming deprecation are:

  • backport the fix in nom to a 1.x.x version (https://github.com/rust-bakery/nom/pull/1657). The fix is currently only live on versions ^5.1.3 || ^6.2.2 || >=7.0.0
  • convince the maintainer of meval to merge https://github.com/rekka/meval-rs/pull/27
  • find an alternative to meval or fork it

adri326 avatar Jun 10 '23 13:06 adri326

I think this should go into another issue.

Anyway, If looking for an alternative, I've had a good experience with evalexpr

dvtomas avatar Jun 11 '23 07:06 dvtomas

Fixed in #40

loony-bean avatar Sep 12 '23 15:09 loony-bean