rene-d / top-crates

Make an index for a selected list of crates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"

About

Make an index for a selected list of crates

License:MIT License


Languages

Language:Python 92.3%Language:Shell 3.5%Language:Rust 2.5%Language:Dockerfile 1.8%