Skip to content

Commit

Permalink
internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 654126390
  • Loading branch information
marksandler2 authored and copybara-github committed Jul 22, 2024
1 parent 520f0a5 commit 7ac19aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pytype/overlays/fiddle_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
_CLASS_ALIASES = {
"Config": "Config",
"PaxConfig": "Config",
"TemplateConfig": "Config",
"Partial": "Partial",
"PaxPartial": "Partial",
}
Expand Down Expand Up @@ -331,11 +332,12 @@ def is_fiddle_buildable_pytd(cls: pytd.Class) -> bool:
# fiddle._src.config.Config
fiddle = re.fullmatch(r"fiddle\.(.+\.)?(Config|Partial)", cls.name)
pax = re.fullmatch(r"(.+\.)?pax_fiddle.(Pax)?(Config|Partial)", cls.name)
return bool(fiddle or pax)
cfbl = re.fullmatch(r"(.+\.)?configurable.(Template)?(Config|)", cls.name)
return bool(fiddle or pax or cfbl)


def get_fiddle_buildable_subclass(cls: pytd.Class) -> str:
if re.search(r"\.(Pax)?Config$", cls.name):
if re.search(r"\.(Pax|Template)?Config$", cls.name):
return "Config"
if re.search(r"\.(Pax)?Partial$", cls.name):
return "Partial"
Expand Down

0 comments on commit 7ac19aa

Please sign in to comment.