Skip to content

Commit 88521cb

Browse files
committed
Fix: Run scons via venv Python to find packaging module
The issue was that packaging was installed in the venv, but scons was being run with the system Python, which couldn't see the venv's packages. Solution: 1. Install scons in the venv (along with other dependencies) 2. Run scons using: venv/bin/python -m SCons This ensures scons runs with the venv's Python environment and can import the packaging module and other dependencies we installed.
1 parent 8c381b1 commit 88521cb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packaging/homebrew/mfc.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ def install
3636

3737
# Build and install Cantera 3.1.0 from source BEFORE MFC build
3838
resource("cantera").stage do
39-
# Install Cantera build dependencies
40-
system venv/"bin/pip", "install", "cython", "numpy", "ruamel.yaml", "packaging"
39+
# Install Cantera build dependencies (including scons)
40+
system venv/"bin/pip", "install", "cython", "numpy", "ruamel.yaml", "packaging", "scons"
4141

4242
# Configure Cantera build
43-
system "scons", "build",
43+
# Run scons with the venv's Python so it can find installed packages
44+
system venv/"bin/python", "-m", "SCons", "build",
4445
"python_package=y",
4546
"f90_interface=n",
4647
"system_sundials=y",
@@ -53,7 +54,7 @@ def install
5354
"-j#{ENV.make_jobs}"
5455

5556
# Install Cantera
56-
system "scons", "install"
57+
system venv/"bin/python", "-m", "SCons", "install"
5758

5859
# Install Cantera Python package into venv
5960
cd "build/python" do

0 commit comments

Comments
 (0)