Skip to content

Commit 2977324

Browse files
committed
homebrew: fix toolchain install without git metadata
1 parent b639628 commit 2977324

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packaging/homebrew/mfc.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,19 @@ def install
2929
# Create Python virtual environment inside libexec (inside Cellar for proper bottling)
3030
venv = libexec/"venv"
3131
system Formula["python@3.12"].opt_bin/"python3.12", "-m", "venv", venv
32-
system venv/"bin/pip", "install", "--upgrade", "pip", "setuptools", "wheel"
32+
system venv/"bin/pip", "install", "--upgrade", "pip", "setuptools", "wheel", "setuptools-scm"
3333

3434
# Install Cantera from PyPI using pre-built wheel (complex package, doesn't need custom flags)
3535
# Cantera has CMake compatibility issues when building from source with newer CMake versions
3636
system venv/"bin/pip", "install", "cantera==3.1.0"
3737

38+
# MFC's toolchain uses VCS-derived versioning (via Hatch/hatch-vcs) and Homebrew builds from
39+
# GitHub release tarballs without a .git directory. Provide a fallback/pretend version so
40+
# metadata generation succeeds during pip install.
41+
ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.to_s
42+
ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC"] = version.to_s
43+
ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc"] = version.to_s
44+
3845
# Install MFC Python package and dependencies into venv
3946
# Use editable install (-e) to avoid RECORD file issues when venv is symlinked at runtime
4047
# Dependencies will use pre-built wheels from PyPI

0 commit comments

Comments
 (0)