Skip to content

Commit

Permalink
Try to fix/workaround CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jherland committed Sep 19, 2024
1 parent 645cf17 commit 63dd427
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fawltydeps/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def debug_print(msg: str) -> None:
if found:
return

elif bin_python.is_file(): # Assume POSIX
elif bin_python.is_file() or bin_python.is_symlink(): # Assume POSIX
debug_print(" - on posix, found bin/python")
if bin_python.is_symlink() and hasattr(bin_python, "readlink"):
debug_print(f" and points to {bin_python.readlink()!r}")
Expand Down
7 changes: 4 additions & 3 deletions fawltydeps/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def __post_init__(self) -> None:
super().__post_init__()
assert self.path.is_dir() # noqa: S101, sanity check

bin_python = self.path.parent.parent.parent / "bin/python"

# Support Windows projects
if sys.platform.startswith("win"):
if (
Expand All @@ -162,9 +164,8 @@ def __post_init__(self) -> None:
):
return # also ok
# Support vitualenvs, poetry2nix envs, system-wide installs, etc.
elif (
self.path.match("lib/python?.*/site-packages")
and (self.path.parent.parent.parent / "bin/python").is_file()
elif self.path.match("lib/python?.*/site-packages") and (
bin_python.is_file() or bin_python.is_symlink()
):
return # all ok

Expand Down

0 comments on commit 63dd427

Please sign in to comment.