Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
/ top-crates Public archive

Make an index for a selected list of crates

License

Notifications You must be signed in to change notification settings

rene-d/top-crates

Repository files navigation

top-crates

top-crates lists the top crates in the Rust ecosystem and their dependencies.

It can build an index that can be configured in Cargo or mirrored by Romt or Panamax.

Both are designed to mirror the entire Rust ecosystem (70-80Gb by early 2022), which can be a drawback.

top-crates can also make a local registry (like cargo local-registry) that can be used with Cargo.

This local registry can be added to a Docker image to create an isolated development environment for Rust.

Usage

Installation

pip3 install tomli python-dateutil

git clone --recursive https://github.com/rene-d/top-crates

Note the --recursive flag: indeed the full crates index is required to resolve dependencies. It takes about 1.5Gb for this index and 0.3Gb for the crates.

Get full usage information with --help or -h.

Configuration

The configuration file top-crates.toml has six self-explanatory sections:

  • top-crates : the most downloaded crates
  • cookbook : to add crates from the Rust Cookbook
  • categories : most downloaded crates by category
  • exclusions : to exclude useless or unwanted crates
  • additions : manually added crates
  • commands : manually added command line tools

Example

Update the crates.io index and prepare the local registry:

./top-crates.py -u -p

Cargo config file

Create or add to the file $CARGO_HOME/config (~/.cargo/config by default) the following lines:

[source.local]
local-registry = "/path/to/local-registry"

[source.crates-io]
replace-with = "local"