Skip to content

Commit af62f81

Browse files
authored
Retain a log of the Pip installation of Pants. (#42)
This was useful in the analysis of our `--find-links` usage, but may also be useful diagnosing install failures going forward. Closes #41
1 parent d2aed70 commit af62f81

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tools/src/scie_pants/install_pants.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def install_pants(
3434
check=True,
3535
)
3636
python = venv_dir / "bin" / "python"
37+
install_log = venv_dir / "pants-install.log"
3738

3839
find_links_options = ("--find-links", find_links) if find_links else ()
3940

@@ -44,6 +45,8 @@ def pip_install(*args: str) -> None:
4445
"-sE",
4546
"-m",
4647
"pip",
48+
"--log",
49+
install_log,
4750
"install",
4851
"--quiet",
4952
*find_links_options,
@@ -52,9 +55,14 @@ def pip_install(*args: str) -> None:
5255
check=True,
5356
)
5457

55-
# Grab the latest pip, but don't advance setuptools past 58 which drops support for the
56-
# `setup` kwarg `use_2to3` which Pants 1.x sdist dependencies (pystache) use.
57-
pip_install("-U", "pip", "setuptools<58", "wheel")
58+
# Pin Pip to 22.3.1 (currently latest). The key semantic that should be preserved by the Pip
59+
# we use is that --find-links are used as a fallback only and PyPI is preferred. This saves us
60+
# money by avoiding fetching wheels from our S3 bucket at https://binaries.pantsbuild.org unless
61+
# absolutely needed.
62+
#
63+
# Also, we don't advance setuptools past 58 which drops support for the `setup` kwarg `use_2to3`
64+
# which Pants 1.x sdist dependencies (pystache) use.
65+
pip_install("-U", "pip==22.3.1", "setuptools<58", "wheel")
5866
pip_install("--progress-bar", "off", *pants_requirements)
5967

6068

0 commit comments

Comments
 (0)