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

Cargo clean-up: Should examples be in the workspace? #880

Open
Xophmeister opened this issue Feb 20, 2025 · 2 comments
Open

Cargo clean-up: Should examples be in the workspace? #880

Xophmeister opened this issue Feb 20, 2025 · 2 comments

Comments

@Xophmeister
Copy link
Member

The examples directory is intended to contain example applications that use Topiary; for example, client-app. Should, however, these be in the Cargo workspace for the project?

  • Currently, they are: This means that they don't standalone (i.e., outside of the workspace) and that, for example, examples/client-app/Cargo.lock is redundant and can be removed.

  • If they should be made standalone, then their dependencies would need to be crates.io + path-based and their Cargo.lock files regenerated.

A more extreme option might be to remove the examples altogether. They serve a purpose -- that is showcasing the topiary-core API relatively straightforwardly, at least compared to the tests/topiary-cli -- but does this warrant the maintenance burden? (@tweag/topiary-core-team Thoughts?)

@yannham
Copy link
Member

yannham commented Feb 20, 2025

My two cents as a Topiary-the-lib consumer: I think the example, albeit small, is very valuable. This is never entirely trivial to retro-engineer how a chain of calls should be done when you don't know the tool yet. I don't think the maintenance burden is very high. Making it stand-alone is probably better on paper, but then it needs to be added separately to the CI, and as you said, the Cargo.toml file needs to be made stand-alone.

I still don't think that's a lot of work, but if it is, then keeping it in the workspace is still vastly superior to getting rid of it. As a consumer I don't really care about the Cargo.toml file, which is easy to transform to a stand-alone one mechanically. If you need to integrate Topiary in an actual project you won't use the simple example as it is, so some adaptation is required anyway. However the code itself , showing the chain of API calls you need to do in order to get some string to be formatted, is the interesting part, IMHO.

@Xophmeister
Copy link
Member Author

Xophmeister commented Feb 20, 2025

Thanks, @yannham 🙏 I would tend to agree. In which case, this issue boils down to:

Delete examples/client-app/Cargo.lock, because it is redundant (and misleading).

Which couldn't be easier 🎉

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

No branches or pull requests

2 participants