Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python package: updated our macOS binary (closes #2256).
- Loading branch information
Showing
6 changed files
with
218 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
src/plugins/support/PythonSupport/tests/data/importstests.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
if __name__ == '__main__': | ||
# Make sure that we can import the modules that should be bundled with our | ||
# Python package | ||
|
||
try: | ||
import bz2 | ||
except ImportError: | ||
print("The 'bz2' module is not present!") | ||
|
||
try: | ||
import ipykernel | ||
except ImportError: | ||
print("The 'ipykernel' module is not present!") | ||
|
||
try: | ||
import IPython | ||
except ImportError: | ||
print("The 'IPython' module is not present!") | ||
|
||
try: | ||
import ipywidgets | ||
except ImportError: | ||
print("The 'ipywidgets' module is not present!") | ||
|
||
try: | ||
import jupyter_console | ||
except ImportError: | ||
print("The 'jupyter_console' module is not present!") | ||
|
||
try: | ||
import jupyterlab | ||
except ImportError: | ||
print("The 'jupyterlab' module is not present!") | ||
|
||
try: | ||
import lxml | ||
except ImportError: | ||
print("The 'lxml' module is not present!") | ||
|
||
try: | ||
import lzma | ||
except ImportError: | ||
print("The 'lzma' module is not present!") | ||
|
||
try: | ||
import matplotlib | ||
except ImportError: | ||
print("The 'matplotlib' module is not present!") | ||
|
||
try: | ||
import nbconvert | ||
except ImportError: | ||
print("The 'nbconvert' module is not present!") | ||
|
||
try: | ||
import notebook | ||
except ImportError: | ||
print("The 'notebook' module is not present!") | ||
|
||
try: | ||
import numpy | ||
except ImportError: | ||
print("The 'numpy' module is not present!") | ||
|
||
try: | ||
import qimage2ndarray | ||
except ImportError: | ||
print("The 'qimage2ndarray' module is not present!") | ||
|
||
try: | ||
import qtconsole | ||
except ImportError: | ||
print("The 'qtconsole' module is not present!") | ||
|
||
try: | ||
import scipy | ||
except ImportError: | ||
print("The 'scipy' module is not present!") | ||
|
||
try: | ||
import sphinx | ||
except ImportError: | ||
print("The 'sphinx' module is not present!") | ||
|
||
try: | ||
import sqlite3 | ||
except ImportError: | ||
print("The 'sqlite3' module is not present!") | ||
|
||
try: | ||
import ssl | ||
except ImportError: | ||
print("The 'ssl' module is not present!") | ||
|
||
try: | ||
import traitlets | ||
except ImportError: | ||
print("The 'traitlets' module is not present!") | ||
|
||
try: | ||
import zlib | ||
except ImportError: | ||
print("The 'zlib' module is not present!") |
13 changes: 13 additions & 0 deletions
13
src/plugins/support/PythonSupport/tests/data/windows/debug/importstests.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
The 'ipykernel' module is not present! | ||
The 'IPython' module is not present! | ||
The 'ipywidgets' module is not present! | ||
The 'jupyter_console' module is not present! | ||
The 'jupyterlab' module is not present! | ||
The 'lxml' module is not present! | ||
The 'matplotlib' module is not present! | ||
The 'nbconvert' module is not present! | ||
The 'notebook' module is not present! | ||
The 'qimage2ndarray' module is not present! | ||
The 'qtconsole' module is not present! | ||
The 'scipy' module is not present! | ||
The 'traitlets' module is not present! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://gnu.org/licenses>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Python support imports tests | ||
//============================================================================== | ||
|
||
#include "../../../../tests/src/testsutils.h" | ||
|
||
//============================================================================== | ||
|
||
#include "importstests.h" | ||
|
||
//============================================================================== | ||
|
||
#include <QtTest/QtTest> | ||
|
||
//============================================================================== | ||
|
||
void ImportsTests::tests() | ||
{ | ||
// Some basic tests to make sure that we can use our Python wrappers | ||
|
||
QStringList output; | ||
|
||
QVERIFY(!OpenCOR::runCli(QStringList() << "-c" << "PythonShell" << OpenCOR::fileName("src/plugins/support/PythonSupport/tests/data/importstests.py"), output)); | ||
#if defined(Q_OS_WIN) && defined(QT_DEBUG) | ||
QCOMPARE(output, OpenCOR::fileContents(OpenCOR::fileName(QString("src/plugins/support/PythonSupport/tests/data/%1/importstests.out").arg(OpenCOR::targetPlatformDir())))); | ||
#else | ||
QCOMPARE(output, QStringList() << QString()); | ||
#endif | ||
} | ||
|
||
//============================================================================== | ||
|
||
QTEST_GUILESS_MAIN(ImportsTests) | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://gnu.org/licenses>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Python support imports tests | ||
//============================================================================== | ||
|
||
#pragma once | ||
|
||
//============================================================================== | ||
|
||
#include <QObject> | ||
|
||
//============================================================================== | ||
|
||
class ImportsTests : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
private slots: | ||
void tests(); | ||
}; | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters