Skip to content

Commit

Permalink
Roll back temporary CI workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul committed Jan 10, 2025
1 parent 6ef44b1 commit 1a11a33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/sophios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

# Well, not THIS file.
auto_gen_header = f"""# This file was autogenerated using the Workflow Inference Compiler, version {__version__}
# https://github.com/PolusAI/workflow-inference-compiler\n"""
# https://github.com/PolusAI/sophios\n"""
21 changes: 3 additions & 18 deletions src/sophios/input_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,6 @@ def write_config_to_disk(config: Json, config_file: Path) -> None:
json.dump(config, f, indent=4, sort_keys=True)


def check_sister_directories(parent_dir: Path, target_names: list[str]) -> bool:
"""Checks if sister directories with given names exist."""

parent_path = Path(parent_dir)
if not parent_path.is_dir():
return False

for target_name in target_names:
sister_path = parent_path.parent / target_name
if not sister_path.is_dir():
return False

return True


def get_config(config_file: Path, default_config_file: Path) -> Json:
"""Returns the config json object from config_file with absolute paths
Expand All @@ -167,10 +152,10 @@ def get_config(config_file: Path, default_config_file: Path) -> Json:
Json: The config json object with absolute filepaths
"""
global_config: Json = {}
ci_sister_dirs = ['mm-workflows', 'image-workflows']
proj_root_dir = 'sophios'
if not config_file.exists():
# check if sophios is run from 'ci environment' dir
if check_sister_directories(Path.cwd(), ci_sister_dirs):
# check if sophios is run from 'project root' dir
if str(Path.cwd()).endswith(proj_root_dir):
if config_file == default_config_file:
global_config = get_default_config()
# write the default config object to the 'global_config.json' file in user's ~/wic directory
Expand Down

0 comments on commit 1a11a33

Please sign in to comment.