File tree 2 files changed +23
-2
lines changed
2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -2398,5 +2398,26 @@ def adjust_int_max_str_digits(max_digits):
2398
2398
finally :
2399
2399
sys .set_int_max_str_digits (current )
2400
2400
2401
+
2402
+ @functools .cache
2403
+ def _findwheel (pkgname ):
2404
+ """Try to find a wheel with the package specified as pkgname.
2405
+
2406
+ If set, the wheels are searched for in WHEEL_PKG_DIR (see ensurepip).
2407
+ Otherwise, they are searched for in the test directory.
2408
+ """
2409
+ wheel_dir = sysconfig .get_config_var ('WHEEL_PKG_DIR' ) or TEST_HOME_DIR
2410
+ filenames = os .listdir (wheel_dir )
2411
+ filenames = sorted (filenames ) # sort this like ensurepip does it
2412
+ for filename in filenames :
2413
+ # filename is like 'pip-21.2.4-py3-none-any.whl'
2414
+ if not filename .endswith (".whl" ):
2415
+ continue
2416
+ prefix = pkgname + '-'
2417
+ if filename .startswith (prefix ):
2418
+ return os .path .join (wheel_dir , filename )
2419
+ raise FileNotFoundError (f"No wheel for { pkgname } found in { wheel_dir } " )
2420
+
2421
+
2401
2422
#For recursion tests, easily exceeds default recursion limit
2402
2423
EXCEEDS_RECURSION_LIMIT = 5000
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ def run_cmd(operation, cmd):
83
83
84
84
cmd = [python , '-X' , 'dev' ,
85
85
'-m' , 'pip' , 'install' ,
86
- support .findfile ('setuptools-67.6.1-py3-none-any.whl ' ),
87
- support .findfile ('wheel-0.40.0-py3-none-any.whl ' )]
86
+ support ._findwheel ('setuptools' ),
87
+ support ._findwheel ('wheel' )]
88
88
run_cmd ('Install build dependencies' , cmd )
89
89
90
90
# Build and install the C++ extension
You can’t perform that action at this time.
0 commit comments