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 af326d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pytype/overlays/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,13 @@ py_library(
pytype.pytd.pytd
pytype.typegraph.cfg
)

py_library(
NAME
trail_configurable_overlay
SRCS
trail_configurable_overlay.py
DEPS
.fiddle_overlay
.overlay
)
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 af326d7

Please sign in to comment.