Skip to content

Commit

Permalink
Add analysis-time deprecation warning
Browse files Browse the repository at this point in the history
Summary:
let folks know when they're building things that will break when 3.8 goes away.

even if the person building is not the one who can upgrade, they would at least know and could reach out to the appropriate owners, in addition to the oncall task that already exists.

Reviewed By: lisroach

Differential Revision: D52589353

fbshipit-source-id: 0fd1e185c15fdaeba99f8fe1e3537df5efc47d49
  • Loading branch information
itamaro authored and facebook-github-bot committed Jan 8, 2024
1 parent 8fae991 commit 6c3a04c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions prelude/python/python_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,19 @@ def python_binary_impl(ctx: AnalysisContext) -> list[Provider]:
if main_module.endswith(".py"):
main_module = main_module[:-3]

if "python-version=3.8" in ctx.attrs.labels:
# buildifier: disable=print
print((
"\033[1;33m \u26A0 " +
"{0} 3.8 is EOL, and is going away by the end of H1 2024. " +
"Upgrade //{1}:{2} to {0} 3.10 now to avoid breakages. " +
"https://fburl.com/py38-sunsetting \033[0m"
).format(
"Cinder" if "python-flavor=cinder" in ctx.attrs.labels else "Python",
ctx.label.package,
ctx.attrs.name,
))

if main_module != None:
main = (EntryPointKind("module"), main_module)
else:
Expand Down

0 comments on commit 6c3a04c

Please sign in to comment.