Skip to content

Commit

Permalink
fix: more fix from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Nov 27, 2024
1 parent 0df58ac commit bea61d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ape_console/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def import_extras_file(file_path) -> ModuleType:
class ApeConsoleNamespace(dict):
def __init__(self, **kwargs):
# Initialize the dictionary with provided keyword arguments
project = kwargs.get("project", self._ape.project)
kwargs["project"] = self._ape.Project(project) if isinstance(project, Path) else project
super().__init__(**kwargs)

def __getitem__(self, key: str):
Expand Down Expand Up @@ -115,11 +117,11 @@ def _ape(self) -> ModuleType:

@cached_property
def _local_path(self) -> Path:
return self._ape.project.path.joinpath(CONSOLE_EXTRAS_FILENAME)
return self["project"].path.joinpath(CONSOLE_EXTRAS_FILENAME)

@cached_property
def _global_path(self) -> Path:
return self._ape.project.config_manager.DATA_FOLDER.joinpath(CONSOLE_EXTRAS_FILENAME)
return self._ape.config.DATA_FOLDER.joinpath(CONSOLE_EXTRAS_FILENAME)

@cached_property
def _local_extras(self) -> dict:
Expand Down

0 comments on commit bea61d6

Please sign in to comment.