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

Add support for alternate registries #201

Closed
bjgill opened this issue Feb 11, 2018 · 3 comments · Fixed by #336
Closed

Add support for alternate registries #201

bjgill opened this issue Feb 11, 2018 · 3 comments · Fixed by #336

Comments

@bjgill
Copy link
Collaborator

bjgill commented Feb 11, 2018

Currently, we assume that https://crates.io is the only registry. Given that alternate registries have landed/will be landing shortly, we should consider extending support.

@cswindle
Copy link

Having a quick look at the code, I think that the things that are required in order to implement this are:

  • add a --registry argument (to match the rest of cargo)
  • when --registry is provided, cargo-edit should use the cargo library to get the registry index using config->get_registry_index(registry)
  • download config.json from the index
  • use the API field to use in a renamed fetch_cratesio

Also I would suggest using registry_index_path for crates.io, this way if a user is using another registry (for example a mirror), then they will use the source which is appropriate to their cargo config.

@bjgill
Copy link
Collaborator Author

bjgill commented Oct 10, 2018

For reference - alternative registry support has now landed in nightly. See https://boats.gitlab.io/blog/post/2017-10-28-alternative-registries/ for documentation on use.

@cswindle
Copy link

An alternative to getting the API using cargo-edit itself, would be to get an interface added to cargo library which allows getting the API (or maybe the whole config.json object from the index), that would then make it a very simple change in cargo-edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants