xdg-rs / dirs

a low-level library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows
186 stars 23 forks source link

Write a script to migrate https://crates.io/crates/dirs/reverse_dependencies to use our crates #8

Open tesuji opened 4 years ago

tesuji commented 4 years ago
sondr3 commented 4 years ago

I've been quickly looking at this to see how feasible it would be, from a quick glance we might have to involve the Crates.io folks because of rate limiting in the crates.io API. I tried looking at the crates.io-index repo to see how much useful information you can extract there, you can at least find all the crates depending on dirs but not their GitHub (or other service) repository nor their crates.io page (though given that there's no namespacing the name field is probably a 1-to-1 for a crates.io/crate/<name>). This is an example of how a crate looks in the index:

Click to expand! ```json { "name": "prj", "vers": "0.1.0", "deps": [ { "name": "clap", "req": "^2", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "crossterm", "req": "^0.14.2", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "dirs", "req": "^2.0", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "fuzzy-matcher", "req": "^0.3.1", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "git2", "req": "^0.11.0", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "serde", "req": "^1.0", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "serde_derive", "req": "^1.0", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "term_size", "req": "^1.0.0-beta1", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" }, { "name": "toml", "req": "^0.5", "features": [], "optional": false, "default_features": true, "target": null, "kind": "normal" } ], "cksum": "341a5e6df29a635b8901aa426f1c6ae688f4150804c2279885e04562373cba93", "features": {}, "yanked": false, "links": null } ```

I think the biggest hurdle is getting the repositories for downstream repos, otherwise I think this would be a fairly straight forward Python script (rate limiting non-withstanding).

sondr3 commented 4 years ago

Small update, I have a somewhat working script for finding downstream dependents on this crate, but still haven't found a good way to get their repositories, I'm looking into just directly scraping the crates.io website which might require getting permission from their team as I cannot find a good way to get this information from an API/the crates.io-index repo.

tesuji commented 4 years ago

https://github.com/dirs-dev/dirs-rs has been maintained again for a while, there aren't high desires for transfer-scripts, I intended to close this issue. But I will keep this issue with P-low instead.