change pypho symlink to submodule and handle new location in _path_fix.py

This commit is contained in:
Joseph Hopfmüller
2024-11-15 20:56:34 +01:00
parent c42da6ca58
commit 5e2d3dd6b7
3 changed files with 8 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ from pathlib import Path
# hack to add the parent directory to the path -> pypho doesn't have to be installed as package
parent_dir = Path(__file__).parent
while not (parent_dir / "pypho").exists() and parent_dir != Path("/"):
while not (parent_dir / "pypho" / "pypho").exists() and parent_dir != Path("/"):
parent_dir = parent_dir.parent
print(f"Adding '{parent_dir}' to 'sys.path' to enable import of '{parent_dir / 'pypho'}'")
sys.path.append(str(parent_dir))
print(f"Adding '{parent_dir / "pypho"}' to 'sys.path' to enable import of '{parent_dir / 'pypho'}'")
sys.path.append(str(parent_dir / "pypho"))