Skip to content

Report crates.io metrics in cargo info subcommand #14438

Open
@Rustin170506

Description

@Rustin170506

Problem

In the current cargo info subcommand, its information comes from the Cargo.toml manifest.
cargo-info includes a lot of different metrics exposed via the crates.io API (so separate from the Index and Cargo.toml)

Looking at the list, some that might be useful include

recent download count (popularity)
last updated/released (give a feel for how active development is)
authors (who maintain this package)

Proposed Solution

From #14418, we cannot directly call the API from the crates-io crate because every API from it requires the token/auth to make the API call.

A doable solution would be to add some crates.io specific API and only report these metrics when the registry is crates.io.

Another option would be to directly call the get function from the crates-io crate (make it public and allow users to specify the Auth parameter) in the cargo info module and limit all specific things within that module.

Or we shouldn't do it at all, because there is no way to support it for other registries.

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-infoS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions