Skip to content

Commit ca1b53e

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
fbcode_builder: drop Python 2 references from getdeps.py comments
Summary: We dropped Python 2 support a long time ago. Two comment blocks in the GHA workflow generator still talk about Python 2: - The "python may be version 2 or version 3 depending on the system" block predates dropping Py2 support and the warning about `python3 may not be a thing` is no longer relevant on any supported runner. - The Windows comment claims `python2.exe is available if needed`, which is false and misleading — the GHA Windows runners ship Python 3 only and expose it as `python`. Replace both with comments that describe what the code actually does today: pick a per-OS interpreter name (`python3` on Linux/macOS, `python` on Windows) for the generated workflows. The behavior is unchanged. Reviewed By: sahilsd Differential Revision: D101585861 fbshipit-source-id: db7c9aae842efdf920c84b297f2f6148cc0e1197
1 parent 22354b3 commit ca1b53e

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

build/fbcode_builder/getdeps.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,11 +1112,9 @@ def write_job_for_platform(self, platform, args): # noqa: C901
11121112
if builder_name == "nop":
11131113
return None
11141114

1115-
# We want to be sure that we're running things with python 3
1116-
# but python versioning is honestly a bit of a frustrating mess.
1117-
# `python` may be version 2 or version 3 depending on the system.
1118-
# python3 may not be a thing at all!
1119-
# Assume an optimistic default
1115+
# The interpreter name varies across runners, so resolve it per-OS
1116+
# below. Default to `python3`, which works on Linux and macOS GHA
1117+
# runners.
11201118
py3 = "python3"
11211119

11221120
if build_opts.is_linux():
@@ -1133,8 +1131,8 @@ def write_job_for_platform(self, platform, args): # noqa: C901
11331131
runs_on = args.runs_on
11341132
else:
11351133
runs_on = "windows-2022"
1136-
# The windows runners are python 3 by default; python2.exe
1137-
# is available if needed.
1134+
# On Windows GHA runners the python 3 interpreter is exposed as
1135+
# `python`, not `python3`.
11381136
py3 = "python"
11391137
else:
11401138
artifacts = "mac"

0 commit comments

Comments
 (0)