Skip to content

Commit

Permalink
Add condition for a virtual environment on Windows to contain a Pytho…
Browse files Browse the repository at this point in the history
…n executable
  • Loading branch information
mknorps committed Jan 8, 2024
1 parent a5af8be commit 83ea1f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fawltydeps/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ def __post_init__(self) -> None:
return # also ok

# Support Windows projects
if sys.platform.startswith("win") and self.path.match(
os.path.join("Lib", "site-packages")
):
return # also ok
if sys.platform.startswith("win"):
if (self.path.parent.parent / "Scripts" / "python.exe").is_file():
if self.path.match(os.path.join("Lib", "site-packages")):
return # also ok

raise ValueError(f"{self.path} is not a valid dir for Python packages!")

Expand Down

0 comments on commit 83ea1f2

Please sign in to comment.