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
// 'Extra' string format is not well specified. It looks like what pip does is
// run things through pkg_resources.safe_extra, which does:
//
// re.sub('[^A-Za-z0-9.-]+', '_', extra).lower()
//
// So A-Z becomes a-z, a-z 0-9 . - are preserved, and any contiguous run of
// other characters becomes a single _.
//
// OTOH, PEP 508's grammar for requirement specifiers says that extras have to
// be "identifiers", which means: first char [A-Za-z0-9], remaining chars also
// allowed to include -_.
//
// I guess for now I'll just pretend that they act the same as package names,
// and see how long I can get away with it.
//
// There's probably a better way to factor this and reduce code duplication...
use crate*;
;
try_from_str_boilerplate!;