File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
import email
2
2
import logging
3
3
import re
4
+ from contextlib import suppress
4
5
from dataclasses import dataclass
5
6
from itertools import groupby
6
7
from operator import attrgetter
@@ -50,7 +51,7 @@ def upload_packages(
50
51
else DummyLocker ()
51
52
)
52
53
53
- distributions = [ parse_distribution ( path ) for path in dist ]
54
+ distributions = parse_distributions ( dist )
54
55
get_name = attrgetter ("name" )
55
56
56
57
for name , group in groupby (sorted (distributions , key = get_name ), get_name ):
@@ -89,6 +90,19 @@ def parse_distribution(path: Path) -> Distribution:
89
90
return Distribution (name , version , path )
90
91
91
92
93
+ def parse_distributions (paths : List [Path ]) -> List [Distribution ]:
94
+ dists = []
95
+ for path in paths :
96
+ if path .is_file ():
97
+ dists .append (parse_distribution (path ))
98
+ elif not path .exists ():
99
+ expanded_paths = Path ("." ).glob (str (path ))
100
+ for expanded_path in (f for f in expanded_paths if f .is_file ()):
101
+ with suppress (S3PyPiError ):
102
+ dists .append (parse_distribution (expanded_path ))
103
+ return dists
104
+
105
+
92
106
def extract_wheel_metadata (path : Path ) -> PackageMetadata :
93
107
with ZipFile (path , "r" ) as whl :
94
108
try :
You can’t perform that action at this time.
0 commit comments