Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal change #1708

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading