Skip to content

Commit 6c3a04c

Browse files
itamarofacebook-github-bot
authored andcommitted
Add analysis-time deprecation warning
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
1 parent 8fae991 commit 6c3a04c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

prelude/python/python_binary.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,19 @@ def python_binary_impl(ctx: AnalysisContext) -> list[Provider]:
714714
if main_module.endswith(".py"):
715715
main_module = main_module[:-3]
716716

717+
if "python-version=3.8" in ctx.attrs.labels:
718+
# buildifier: disable=print
719+
print((
720+
"\033[1;33m \u26A0 " +
721+
"{0} 3.8 is EOL, and is going away by the end of H1 2024. " +
722+
"Upgrade //{1}:{2} to {0} 3.10 now to avoid breakages. " +
723+
"https://fburl.com/py38-sunsetting \033[0m"
724+
).format(
725+
"Cinder" if "python-flavor=cinder" in ctx.attrs.labels else "Python",
726+
ctx.label.package,
727+
ctx.attrs.name,
728+
))
729+
717730
if main_module != None:
718731
main = (EntryPointKind("module"), main_module)
719732
else:

0 commit comments

Comments
 (0)