@@ -62,6 +62,13 @@ def add_options(self) -> None:
62
62
help = "Download packages into <dir>." ,
63
63
)
64
64
65
+ self .cmd_opts .add_option (
66
+ "--dry-run" ,
67
+ dest = "dry_run" ,
68
+ action = "store_true" ,
69
+ help = "Avoid actually downloading wheels." ,
70
+ )
71
+
65
72
cmdoptions .add_target_python_options (self .cmd_opts )
66
73
67
74
index_opts = cmdoptions .make_option_group (
@@ -122,19 +129,21 @@ def run(self, options: Values, args: List[str]) -> int:
122
129
options = options ,
123
130
ignore_requires_python = options .ignore_requires_python ,
124
131
py_version_info = options .python_version ,
132
+ dry_run = options .dry_run ,
125
133
)
126
134
127
135
self .trace_basic_info (finder )
128
136
129
137
requirement_set = resolver .resolve (reqs , check_supported_wheels = True )
130
138
131
- downloaded : List [str ] = []
132
- for req in requirement_set .requirements .values ():
133
- if req .satisfied_by is None :
134
- assert req .name is not None
135
- preparer .save_linked_requirement (req )
136
- downloaded .append (req .name )
137
- if downloaded :
138
- write_output ("Successfully downloaded %s" , " " .join (downloaded ))
139
+ if not options .dry_run :
140
+ downloaded : List [str ] = []
141
+ for req in requirement_set .requirements .values ():
142
+ if req .satisfied_by is None :
143
+ assert req .name is not None
144
+ preparer .save_linked_requirement (req )
145
+ downloaded .append (req .name )
146
+ if downloaded :
147
+ write_output ("Successfully downloaded %s" , " " .join (downloaded ))
139
148
140
149
return SUCCESS
0 commit comments