Skip to content

Commit

Permalink
Merge 9f8f06c into 6860e42
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-schwartz authored Nov 14, 2022
2 parents 6860e42 + 9f8f06c commit a1f3d84
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ jobs:
- uses: actions/checkout@v2
# Avoid picking up an older version of LLVM that does not work.
- run: brew update
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
# use python3 from homebrew because it is a valid framework, unlike the actions one:
# https://github.com/actions/setup-python/issues/58
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 python3 boost-python3 gtk-doc
- run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc
- run: |
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pip
Expand Down
17 changes: 12 additions & 5 deletions test cases/python/2 extmodule/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ py.install_sources(blaster, subdir: 'pure')

py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
if py3_pkg_dep.found()
python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir')

# Check we can apply a version constraint
dependency('python3', version: '>=@0@'.format(py_dep.version()))
py3_dep_majver = py3_pkg_dep.version().split('.')
py3_dep_majver = py3_dep_majver[0] + '.' + py3_dep_majver[1]
message(f'got two pythons: pkg-config is @py3_dep_majver@, and module is', py.language_version())
if py3_dep_majver != py.language_version()
message('skipped python3 pkg-config test because the default python3 is different from Meson\'s')
else
python_lib_dir = py3_pkg_dep.get_pkgconfig_variable('libdir')

# Check we can apply a version constraint
dependency('python3', version: '>=@0@'.format(py_dep.version()))
endif
else
message('Skipped python3 pkg-config test')
message('Skipped python3 pkg-config test because it was not found')
endif
6 changes: 6 additions & 0 deletions test cases/python3/3 cython/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ py3_dep = dependency('python3', required : false)

if cython.found() and py3_dep.found()
py3_dep = dependency('python3')
py3_dep_majver = py3_dep.version().split('.')
py3_dep_majver = py3_dep_majver[0] + '.' + py3_dep_majver[1]
py3_mod = import('python3')
py3 = py3_mod.find_python()
if py3_dep_majver != py3_mod.language_version()
v = py3_mod.language_version()
error('MESON_SKIP_TEST: deprecated python3 module is non-functional when default python3 is different from Meson\'s', v)
endif
subdir('libdir')

test('cython tester',
Expand Down

0 comments on commit a1f3d84

Please sign in to comment.