Skip to content

Commit 3a54e80

Browse files
committed
dev_environment python - create user site packages folder if missing
E.g. it might be missing if Python was just installed. Also print paths first before symlinking, making it easier to debug.
1 parent f102c7c commit 3a54e80

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ifcopenshell-python/scripts/dev_environment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from pathlib import Path
1212

1313
SITE = Path(site.getusersitepackages())
14+
SITE.mkdir(parents=True, exist_ok=True)
1415
REPO_PATH = Path(__file__).parent.parent.parent.parent
1516
REPO_PATH_SRC = REPO_PATH / "src"
1617
assert REPO_PATH_SRC.exists(), f"'{REPO_PATH_SRC}' doesn't exist."
@@ -36,8 +37,8 @@
3637
if package_path.exists():
3738
# I guess it's a directory.
3839
shutil.rmtree(package_path)
39-
package_path.symlink_to(repo_package_path, True)
4040
print(f"Symlinking {package_path} -> {repo_package_path}")
41+
package_path.symlink_to(repo_package_path, True)
4142

4243

4344
PACKAGE_PATH = SITE / "ifcopenshell"

0 commit comments

Comments
 (0)