-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathname_map.rs
76 lines (70 loc) · 2.34 KB
/
name_map.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use phf::phf_ordered_map;
/// This list represents the mapping between package name you install and the module name you
/// import.
///
/// This is required because there is not always a programatic way to determine this mapping [[1]].
///
/// Some entries in the map also exploit the set of aliases we automatically
/// generate (e.g., databricks-sql), to improve the mapping.
///
/// If you would like to add or improve this list, please file a PR:
/// <https://github.com/lukehsiao/poetry-udeps>.
///
/// Please try to keep this list sorted lexicographically and wrapped to 79
/// columns (inclusive).
///
/// [1]: https://stackoverflow.com/a/54853084
#[rustfmt::skip]
pub static KNOWN_NAMES: phf::OrderedMap<&str, &str> = phf_ordered_map! {
"Flask" => "flask",
"PyYAML" => "yaml",
"SQLAlchemy" => "sqlalchemy",
"Wand" => "wand",
"argon2-cffi" => "argon2",
"beautifulsoup4" => "bs4",
"boto3-stubs" => "mypy_boto3_iam",
"celery-redbeat" => "redbeat",
"databricks-sdk" => "databricks.sdk",
"databricks-sql-connector" => "databricks-sql",
"faiss-cpu" => "faiss",
"faiss-gpu" => "faiss",
"google-api-python-client" => "googleapiclient",
"google-cloud-pubsub" => "google-cloud-pubsub_v1",
"grpcio" => "grpc",
"hydra-colorlog" => "colorlog",
"hydra-core" => "hydra",
"jupyter" => "IPython",
"levenshtein" => "Levenshtein",
"opensearch-py" => "opensearchpy",
"pdfminer.six" => "pdfminer",
"protobuf" => "google.protobuf",
"pyautogen" => "autogen",
"pybars3" => "pybars",
"python-jose" => "jose",
"python-multipart" => "multipart",
"python-slugify" => "slugify",
"pytorch-nlp" => "torchnlp",
"pyvespa" => "vespa",
"scikit-learn" => "sklearn",
"snowflake-connector-python" => "snowflake",
"unicodedata2" => "unicodedata",
"vl-convert-python" => "vl_convert",
};
#[cfg(test)]
mod tests {
use super::KNOWN_NAMES;
#[test]
fn known_names_are_sorted() {
let mut names = KNOWN_NAMES.entries().map(|(name, _alias)| name);
let Some(mut previous_name) = names.next() else {
return;
};
for name in names {
assert!(
name > previous_name,
r#""{name}" should be sorted before "{previous_name}" in `KNOWN_NAMES`"#,
);
previous_name = name;
}
}
}