Skip to content

Commit

Permalink
feat: add check to ensure no module is named base
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiljha committed Mar 30, 2023
1 parent eb2940f commit 349e368
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion transpire/internal/cli/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def build(out_path, **_) -> None:
logger.info(f"Building {module.name}")
render.write_manifests(config, module.objects, module.name, out_path)

# TODO: Disallow calling a transpire module "base", via Pydantic.
logger.info("Writing bases")
basedir = Path(out_path) / "base"
if basedir.exists():
Expand Down
4 changes: 3 additions & 1 deletion transpire/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def __init__(self, pymodule: ModuleType, context=None):

@property
def name(self) -> str:
return self.pymodule.name
name = self.pymodule.name
assert name != "base"
return name

@cached_property
def namespace(self) -> str:
Expand Down

0 comments on commit 349e368

Please sign in to comment.