Skip to content

Commit

Permalink
Merge pull request highperformancecoder#214 from Suthiro/sipfix
Browse files Browse the repository at this point in the history
Fix for new CI environment
  • Loading branch information
highperformancecoder authored Apr 5, 2021
2 parents f429063 + ebd4678 commit faf0b7a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ jobs:
- name: Install Python packages
if: ${{ matrix.qt_ver == '5.15.2' }}
run: pip install sip==5.5.0 pyqt5 numpy
run: |
pip install sip==5.5.0 pyqt5==5.15.2 PyQt5-sip==12.8.1 numpy
- name: Configuring
run: |
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
mingw-w64-x86_64-gsl
mingw-w64-x86_64-gl2ps
mingw-w64-x86_64-gtest
mingw-w64-x86_64-sip5
mingw-w64-x86_64-sip4
mingw-w64-x86_64-python-pyqt5
mingw-w64-x86_64-python-numpy
Expand Down Expand Up @@ -198,8 +199,11 @@ jobs:

- name: Install prerequisties
run: |
brew install muparser gsl gl2ps googletest sip
pip install pyqt5 numpy
brew install muparser gsl gl2ps googletest
brew tap-new $USER/local-sip
brew extract --version=4.19.25 sip $USER/local-sip
brew install [email protected]
pip install pyqt5 numpy
- name: Configuring
run: |
Expand Down
13 changes: 10 additions & 3 deletions libscidavis/src/PythonScripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@

#include <iostream>

#define str(x) xstr(x)
#define xstr(x) #x
// sorry for such meaningless macro names, but this way name collision is unlikely
#define qwezstringify(x) x2strtr(x)
#define x2strtr(x) #x

const char* pythonHome = qwezstringify(PYTHONHOME);

#undef qwezstringify
#undef x2strtr


#if PY_VERSION_HEX < 0x020400A1
typedef struct _traceback
Expand Down Expand Up @@ -210,7 +217,7 @@ PythonScripting::PythonScripting(ApplicationWindow *parent, bool batch)
// if we need to bundle Python libraries with the executable,
// specify the library location here
#ifdef PYTHONHOME
Py_SetPythonHome(Py_DecodeLocale(str(PYTHONHOME), NULL));
Py_SetPythonHome(Py_DecodeLocale(pythonHome, NULL));
#endif
// PyEval_InitThreads ();
#if PY_MAJOR_VERSION >= 3
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ if( NOT (SEARCH_FOR_UPDATES OR DOWNLOAD_LINKS) )
endif()

if( SCRIPTING_PYTHON )

file( COPY pythonTests/ DESTINATION ./tmp )
file( COPY ../scidavis-logo.png DESTINATION ./tmp )

file( GLOB pythonTests pythonTests/*.py )
# qwtPlotCurve segfault with sip5 or macos
if( SIP_VERSION VERSION_GREATER_EQUAL 5 OR APPLE )
if( SIP_VERSION VERSION_GREATER_EQUAL 5 OR APPLE OR MSYS )
list( REMOVE_ITEM pythonTests ${CMAKE_CURRENT_SOURCE_DIR}/pythonTests/qwtPlotCurve.py )
endif()

Expand Down

0 comments on commit faf0b7a

Please sign in to comment.