Any workarounds for publishing on crates.io without publishing all deps?

I want to publish my crate on crates.io. The problem is it consists of many smaller crates. It's too much work to keep them updated on crates.io for every release (though I guess it could be automated with some scripting), and also these crates are not reusable (expect for one crate) so it'd be a lot of useless packages on crates.io.

I'm wondering if there's a way to upload the package on crates.io somehow. Maybe some tool that combines all local crates (given as path or git dependencies) or something like that. Is that possible? Are there any hacks/workarounds for this?

I think scripting is your best option. To my knowledge, crates are always uploaded 1 at a time.

Could some of these utility crates be moved into the main crate as modules?

1 Like

This entire project could be just one crate, and at some point in the past it almost was a single crate (IIRC it was 2 or 3 crate). I split it into multiple crates because:

  • It's easy to see dependencies between crates than dependencies between modules.
  • It's too easy to introduce recursive dependencies in between modules.
  • It's easier to navigate with multiple crates becuase cargo doc shows API of crates.
  • Compile/check times are much better with multiple crates as only the crate I'm working on is recompiled/checked most of the time.

This recent thread discusses automated scripts for publishing multiple packages together:

In the long term, something like this proposal might allow publishing a group of library crates together as a single package: