@@ -263,6 +263,37 @@ def _build_wheel_pep517(
263
263
return os .path .join (tempd , wheel_name )
264
264
265
265
266
+ def _collect_buildset (
267
+ requirements , # type: Iterable[InstallRequirement]
268
+ wheel_cache , # type: WheelCache
269
+ check_binary_allowed , # type: BinaryAllowedPredicate
270
+ need_wheel , # type: bool
271
+ ):
272
+ # type: (...) -> List[Tuple[InstallRequirement, str]]
273
+ """Return the list of InstallRequirement that need to be built,
274
+ with the persistent or temporary cache directory where the built
275
+ wheel needs to be stored.
276
+ """
277
+ buildset = []
278
+ cache_available = bool (wheel_cache .cache_dir )
279
+ for req in requirements :
280
+ if not should_build (
281
+ req ,
282
+ need_wheel = need_wheel ,
283
+ check_binary_allowed = check_binary_allowed ,
284
+ ):
285
+ continue
286
+ if (
287
+ cache_available and
288
+ should_cache (req , check_binary_allowed )
289
+ ):
290
+ cache_dir = wheel_cache .get_path_for_link (req .link )
291
+ else :
292
+ cache_dir = wheel_cache .get_ephem_path_for_link (req .link )
293
+ buildset .append ((req , cache_dir ))
294
+ return buildset
295
+
296
+
266
297
def _always_true (_ ):
267
298
# type: (Any) -> bool
268
299
return True
@@ -367,35 +398,6 @@ def _clean_one(self, req):
367
398
logger .error ('Failed cleaning build dir for %s' , req .name )
368
399
return False
369
400
370
- def _collect_buildset (
371
- self ,
372
- requirements , # type: Iterable[InstallRequirement]
373
- need_wheel , # type: bool
374
- ):
375
- # type: (...) -> List[Tuple[InstallRequirement, str]]
376
- """Return the list of InstallRequirement that need to be built,
377
- with the persistent or temporary cache directory where the built
378
- wheel needs to be stored.
379
- """
380
- buildset = []
381
- cache_available = bool (self .wheel_cache .cache_dir )
382
- for req in requirements :
383
- if not should_build (
384
- req ,
385
- need_wheel = need_wheel ,
386
- check_binary_allowed = self .check_binary_allowed ,
387
- ):
388
- continue
389
- if (
390
- cache_available and
391
- should_cache (req , self .check_binary_allowed )
392
- ):
393
- cache_dir = self .wheel_cache .get_path_for_link (req .link )
394
- else :
395
- cache_dir = self .wheel_cache .get_ephem_path_for_link (req .link )
396
- buildset .append ((req , cache_dir ))
397
- return buildset
398
-
399
401
def build (
400
402
self ,
401
403
requirements , # type: Iterable[InstallRequirement]
@@ -418,8 +420,11 @@ def build(
418
420
(not should_unpack and self ._wheel_dir )
419
421
)
420
422
421
- buildset = self ._collect_buildset (
422
- requirements , need_wheel = not should_unpack
423
+ buildset = _collect_buildset (
424
+ requirements ,
425
+ wheel_cache = self .wheel_cache ,
426
+ check_binary_allowed = self .check_binary_allowed ,
427
+ need_wheel = not should_unpack ,
423
428
)
424
429
if not buildset :
425
430
return []
0 commit comments