@@ -1270,17 +1270,24 @@ def build_cpython(pgo=False):
1270
1270
python_archive = download_entry ('cpython-3.7' , BUILD )
1271
1271
python_version = DOWNLOADS ['cpython-3.7' ]['version' ]
1272
1272
1273
+ setuptools_archive = download_entry ('setuptools' , BUILD )
1274
+ pip_archive = download_entry ('pip' , BUILD )
1275
+
1273
1276
openssl_bin_archive = BUILD / 'openssl-windows.tar'
1274
1277
1275
1278
with tempfile .TemporaryDirectory () as td :
1276
1279
td = pathlib .Path (td )
1277
1280
1278
1281
with concurrent .futures .ThreadPoolExecutor (7 ) as e :
1279
1282
for a in (python_archive , bzip2_archive , openssl_bin_archive ,
1280
- sqlite_archive , tk_bin_archive , xz_archive , zlib_archive ):
1283
+ pip_archive , sqlite_archive , tk_bin_archive , xz_archive ,
1284
+ zlib_archive ):
1281
1285
log ('extracting %s to %s' % (a , td ))
1282
1286
e .submit (extract_tar_to_directory , a , td )
1283
1287
1288
+ with zipfile .ZipFile (setuptools_archive ) as zf :
1289
+ zf .extractall (td )
1290
+
1284
1291
cpython_source_path = td / ('Python-%s' % python_version )
1285
1292
pcbuild_path = cpython_source_path / 'PCBuild'
1286
1293
@@ -1355,6 +1362,25 @@ def build_cpython(pgo=False):
1355
1362
pcbuild_path ,
1356
1363
os .environ )
1357
1364
1365
+ # Install setuptools and pip.
1366
+ exec_and_log (
1367
+ [
1368
+ str (install_dir / 'python.exe' ),
1369
+ 'setup.py' ,
1370
+ 'install' ,
1371
+ ],
1372
+ str (td / ('setuptools-%s' % DOWNLOADS ['setuptools' ]['version' ])),
1373
+ os .environ )
1374
+
1375
+ exec_and_log (
1376
+ [
1377
+ str (install_dir / 'python.exe' ),
1378
+ 'setup.py' ,
1379
+ 'install' ,
1380
+ ],
1381
+ str (td / ('pip-%s' % DOWNLOADS ['pip' ]['version' ])),
1382
+ os .environ )
1383
+
1358
1384
# Now copy the build artifacts into the output directory.
1359
1385
build_info = collect_python_build_artifacts (
1360
1386
pcbuild_path , out_dir / 'python' , 'amd64' , artifact_config )
0 commit comments