Skip to content

Commit fdc4ee0

Browse files
committed
fix: Handle errors during poetry, also include fallback
1 parent b392ae2 commit fdc4ee0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

codeenigma/bundler/poetry.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,19 @@ def create_extension(
7373
)
7474

7575
rich.print("[bold blue]Building extension using poetry[/bold blue]")
76-
subprocess.run(
77-
["poetry", "run", "python", "setup.py", "build_ext", "--inplace"],
78-
cwd=str(location),
79-
check=True,
80-
)
76+
try:
77+
subprocess.run(
78+
["poetry", "run", "python", "setup.py", "build_ext", "--inplace"],
79+
cwd=str(location),
80+
check=True,
81+
)
82+
except subprocess.CalledProcessError:
83+
import sys
84+
subprocess.run(
85+
[sys.executable, "setup.py", "build_ext", "--inplace"],
86+
cwd=str(location),
87+
check=True,
88+
)
8189

8290
so_file = list(location.glob("*.so"))[-1]
8391
# clean up intermediate files

0 commit comments

Comments
 (0)