File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 18
18
load ("//python/private:normalize_name.bzl" , "normalize_name" )
19
19
load (":parse_whl_name.bzl" , "parse_whl_name" )
20
20
21
- def whl_repo_name (filename , sha256 ):
21
+ def whl_repo_name (filename , sha256 , extras ):
22
22
"""Return a valid whl_library repo name given a distribution filename.
23
23
24
24
Args:
25
25
filename: {type}`str` the filename of the distribution.
26
26
sha256: {type}`str` the sha256 of the distribution.
27
+ extras: {type}`list[str]` the extras for the requirement. TODO(hartikainen): Note sure if this is the right place for extras.
27
28
28
29
Returns:
29
30
a string that can be used in {obj}`whl_library`.
@@ -34,6 +35,7 @@ def whl_repo_name(filename, sha256):
34
35
# Then the filename is basically foo-3.2.1.<ext>
35
36
name , _ , tail = filename .rpartition ("-" )
36
37
parts .append (normalize_name (name ))
38
+ parts .extend (sorted (extras ))
37
39
if sha256 :
38
40
parts .append ("sdist" )
39
41
version = ""
@@ -53,6 +55,7 @@ def whl_repo_name(filename, sha256):
53
55
parts .append (python_tag )
54
56
parts .append (abi_tag )
55
57
parts .append (platform_tag )
58
+ parts .extend (sorted (extras ))
56
59
57
60
if sha256 :
58
61
parts .append (sha256 [:8 ])
You can’t perform that action at this time.
0 commit comments