Skip to content

Commit dfb21f2

Browse files
committed
CI-unixish.yml: use Python version provided by platform
1 parent 0cdf571 commit dfb21f2

4 files changed

Lines changed: 24 additions & 17 deletions

File tree

.github/workflows/CI-unixish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v2
1919

20-
- name: Set up Python 3.10
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: '3.10'
24-
2520
- name: Install missing software on ubuntu
2621
if: contains(matrix.os, 'ubuntu')
2722
run: |
@@ -38,12 +33,13 @@ jobs:
3833
- name: Install missing software on macos
3934
if: contains(matrix.os, 'macos')
4035
run: |
41-
brew install coreutils z3 qt@5
36+
brew install coreutils python3 z3 qt@5
4237
38+
# TODO: we might not default to python3
4339
- name: Install missing Python packages
4440
run: |
45-
python -m pip install pip --upgrade
46-
python -m pip install pytest
41+
python3 -m pip install pip --upgrade
42+
python3 -m pip install pytest
4743
4844
- name: CMake build on ubuntu (with GUI / system tinyxml2)
4945
if: contains(matrix.os, 'ubuntu')
@@ -119,11 +115,11 @@ jobs:
119115
- name: Run test/cli
120116
run: |
121117
cd test/cli
122-
pytest test-*.py
118+
python3 -m pytest test-*.py
123119
cd ../../..
124120
ln -s cppcheck 'cpp check'
125121
cd 'cpp check/test/cli'
126-
pytest test-*.py
122+
python3 -m pytest test-*.py
127123
128124
# fails on macos since some includes (e.g. sys/epoll.h) are not available
129125
- name: Run cfg tests

cmake/findDependencies.cmake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ endif()
3434
set(CMAKE_INCLUDE_CURRENT_DIR ON)
3535

3636
if (NOT USE_MATCHCOMPILER_OPT MATCHES "Off")
37-
find_package(PythonInterp)
38-
if (NOT ${PYTHONINTERP_FOUND})
39-
message(WARNING "No python interpreter found. Therefore, the match compiler is switched off.")
40-
set(USE_MATCHCOMPILER_OPT "Off")
37+
find_package(PythonInterp 3 QUIET)
38+
if (NOT PYTHONINTERP_FOUND)
39+
set(PYTHONINTERP_FOUND "")
40+
find_package(PythonInterp 2.7 QUIET)
41+
if (NOT PYTHONINTERP_FOUND)
42+
message(WARNING "No python interpreter found. Therefore, the match compiler is switched off.")
43+
set(USE_MATCHCOMPILER_OPT "Off")
44+
endif()
4145
endif()
4246
endif()
4347

@@ -48,7 +52,6 @@ if (NOT USE_BUNDLED_TINYXML2)
4852
if (NOT tinyxml2_LIBRARY)
4953
message(FATAL_ERROR "tinyxml2 has not been found")
5054
else()
51-
message(STATUS "tinyxml2_LIBRARY: ${tinyxml2_LIBRARY}")
5255
set(tinyxml2_FOUND 1)
5356
endif()
5457
endif()

cmake/printInfo.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,20 @@ if (HAVE_RULES)
4747
message( STATUS "PCRE_LIBRARY = ${PCRE_LIBRARY}" )
4848
endif()
4949
message( STATUS )
50+
if (NOT USE_MATCHCOMPILER_OPT MATCHES "Off")
51+
message( STATUS "PYTHON_VERSION_STRING = ${PYTHON_VERSION_STRING}" )
52+
message( STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}" )
53+
endif()
54+
message( STATUS )
5055
message( STATUS "USE_Z3 = ${USE_Z3}" )
5156
if (USE_Z3)
5257
message( STATUS "Z3_LIBRARIES = ${Z3_LIBRARIES}" )
5358
message( STATUS "Z3_CXX_INCLUDE_DIRS = ${Z3_CXX_INCLUDE_DIRS}" )
5459
endif()
5560
message( STATUS "USE_BUNDLED_TINYXML2 = ${USE_BUNDLED_TINYXML2}" )
61+
if (NOT USE_BUNDLED_TINYXML2)
62+
message(STATUS "tinyxml2_LIBRARY = ${tinyxml2_LIBRARY}")
63+
endif()
5664
message( STATUS )
5765

5866
if(${ANALYZE_ADDRESS})

tools/dmake.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ int main(int argc, char **argv)
254254
<< "endif\n";
255255
fout << "ifeq ($(MATCHCOMPILER),yes)\n"
256256
<< " # Find available Python interpreter\n"
257-
<< " PYTHON_INTERPRETER := $(shell which python)\n"
257+
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
258258
<< " ifndef PYTHON_INTERPRETER\n"
259-
<< " PYTHON_INTERPRETER := $(shell which python3)\n"
259+
<< " PYTHON_INTERPRETER := $(shell which python)\n"
260260
<< " endif\n"
261261
<< " ifndef PYTHON_INTERPRETER\n"
262262
<< " $(error Did not find a Python interpreter)\n"

0 commit comments

Comments
 (0)