Is there a sandbox for crates.io

I would like to "test" publishing a crate before actually publishing a crate, if possible. Is there a sandbox crate.io I can use for testing?

Thnx
Matt

You can cargo publish --dry-run, is that enough for you?

I don't think so. Here's what I want to answer:

If I publish a crate, and move the repo to another location after I publish the crate, what happens? will I have to come up with a whole new crate name the next time I publish from the changed repo?

I've read over the cargo documentation. I didn't see information I needed. I may have misread, missed it etc....

Someone working with me asked if there was a sandbox to play around in and understand the process better.

Matt

crates.io doesn't care about the location of a crate - it just checks that whoever publishes it has authorization to do so.

2 Likes

BTW, if you want to try crate's code as if was published, but without publishing it, use [patch.crates-io] section.

2 Likes

This might be something we should look into. I know Python's PyPI has a test server which allows you to go through the entire upload process and see the outcome without touching the "real" package index.

I know in the past I've had to do multiple patch releases after forgetting to fill in all the Cargo.toml metadata or making some other silly mistake.

1 Like

I have encountered the same issues, but I'm not sure if a test server is worth the effort.

An already existing crate configuration example that's completely fleshed out will solve the issue directly. I'd say one or more documentation entries mentioning such crates will prevent a lot of try-and-test cycles.
In the case of a configuration mistake, it's completely valid to update the PATCH version and there is also no cost attached to uploading new crate versions.

Another solution would be to allow metadata updates without the requirement of an updated version, but that requires more complex logic on the server part. In my opinion, adding this complexity is not worth it because pushing metadata updates alone isn't "wrong". It's safe to assume that this option might cause confusion because of hash mismatches.

1 Like