Skip to content

Commit

Permalink
[CI] Switch to Homebrew Python on macOS
Browse files Browse the repository at this point in the history
This avoids weird linker issues where the GitHub Actions Python
required linkage to libintl but the only available version of
libintl, installed in Homebrew, was targeting a different macOS
version.
  • Loading branch information
speth committed Sep 7, 2022
1 parent 44b6171 commit 9122029
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,22 @@ jobs:
name: Checkout the repository
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Brew dependencies
run: brew install boost libomp
run: |
brew install boost libomp scons python@${{ matrix.python-version }}
- name: Upgrade pip
run: python3 -m pip install -U pip 'setuptools>=47.0.0,<48' wheel
- name: Install Python dependencies
run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest
run: python3 -m pip install ruamel.yaml numpy cython h5py pandas pytest
pytest-github-actions-annotate-failures
- name: Install typing_extensions for Python 3.7
if: matrix.python-version == '3.7'
run: python3 -m pip install typing_extensions
- name: Build Cantera
run: python3 `which scons` build env_vars=all -j3 debug=n --debug=time
run: scons build env_vars=all -j3 debug=n --debug=time
- name: Test Cantera
run:
python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time
scons test show_long_tests=yes verbose_tests=yes --debug=time

# Coverage is its own job because macOS builds of the samples
# use Homebrew gfortran which is not compatible for coverage
Expand Down
4 changes: 2 additions & 2 deletions site_scons/buildutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,10 +1301,10 @@ def setup_python_env(env):
env["site_packages"] = info["site_packages"]
env["user_site_packages"] = info["user_site_packages"]
if env["OS"] != "Windows":
env["py_libpath"] = info["LIBPL"]
env["py_libpath"] = [info["LIBPL"], info["LIBDIR"]]
py_lib = "python" + info["py_version_short"] + info["abiflags"]
else:
env["py_libpath"] = info["installed_base"] + "\\libs"
env["py_libpath"] = [info["installed_base"] + "\\libs"]
py_lib = "python" + py_version_nodot
env["py_libs"] = [py_lib] + [lib[2:] for lib in info.get("LIBS", "").split()
if lib.startswith("-l")]
Expand Down
2 changes: 1 addition & 1 deletion src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if env["python_package"] == "full":
localenv.Append(LIBS=pyenv["py_libs"], LIBPATH=pyenv["py_libpath"])
env["cantera_libs"].extend(pyenv["py_libs"])
env.Append(LIBPATH=pyenv["py_libpath"])
env["extra_lib_dirs"].append(pyenv["py_libpath"])
env["extra_lib_dirs"].extend(pyenv["py_libpath"])

# build the Cantera static library
lib = build(localenv.StaticLibrary('../lib/cantera', libraryTargets,
Expand Down

0 comments on commit 9122029

Please sign in to comment.