Skip to content

Commit e976313

Browse files
committed
windows: install setuptools and pip
1 parent d09e012 commit e976313

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

cpython-windows/build.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,17 +1270,24 @@ def build_cpython(pgo=False):
12701270
python_archive = download_entry('cpython-3.7', BUILD)
12711271
python_version = DOWNLOADS['cpython-3.7']['version']
12721272

1273+
setuptools_archive = download_entry('setuptools', BUILD)
1274+
pip_archive = download_entry('pip', BUILD)
1275+
12731276
openssl_bin_archive = BUILD / 'openssl-windows.tar'
12741277

12751278
with tempfile.TemporaryDirectory() as td:
12761279
td = pathlib.Path(td)
12771280

12781281
with concurrent.futures.ThreadPoolExecutor(7) as e:
12791282
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):
12811285
log('extracting %s to %s' % (a, td))
12821286
e.submit(extract_tar_to_directory, a, td)
12831287

1288+
with zipfile.ZipFile(setuptools_archive) as zf:
1289+
zf.extractall(td)
1290+
12841291
cpython_source_path = td / ('Python-%s' % python_version)
12851292
pcbuild_path = cpython_source_path / 'PCBuild'
12861293

@@ -1355,6 +1362,25 @@ def build_cpython(pgo=False):
13551362
pcbuild_path,
13561363
os.environ)
13571364

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+
13581384
# Now copy the build artifacts into the output directory.
13591385
build_info = collect_python_build_artifacts(
13601386
pcbuild_path, out_dir / 'python', 'amd64', artifact_config)

0 commit comments

Comments
 (0)