Skip to content

Commit

Permalink
fix: hpyhen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 18, 2023
1 parent bd5f20a commit ca90a9e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/ape/api/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,26 +416,25 @@ def _extract_local_manifest(

except ValueError as err:
if project_path.parent.is_dir():
logger.warning(
"Was given a file-path to a non-manifest file. Using parent directory."
)
project_path = project_path.parent

else:
raise ProjectError(f"Invalid local project '{project_path}'.") from err
raise ProjectError(f"Invalid manifest file: '{project_path}'.") from err

else:
# Was given a path to a manifest JSON.
self._write_manifest_to_cache(manifest)
return manifest

elif (project_path.parent / project_path.name.replace("-", "_")).is_dir():
project_path = project_path.parent / project_path.name.replace("-", "_")

elif (project_path.parent / project_path.name.replace("_", "-")).is_dir():
project_path = project_path.parent / project_path.name.replace("_", "-")

elif project_path.parent.is_dir():
logger.warning("Was given a file-path to a non-manifest file. Using parent directory.")
project_path = project_path.parent

else:
raise ProjectError(f"Invalid local project '{project_path}'.")

# NOTE: Dependencies are not compiled here. Instead, the sources are packaged
# for later usage via imports. For legacy reasons, many dependency-esque projects
# are not meant to compile on their own.
Expand Down

0 comments on commit ca90a9e

Please sign in to comment.