-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting fenics as install requirement may break the installation (see #103). We therefore check whether fenics is installed and abort, if this is not the case.
- Loading branch information
1 parent
c9cfbba
commit e610023
Showing
1 changed file
with
10 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,15 @@ | |
if sys.version_info[0] < 3: | ||
raise Exception("fenicsprecice only supports Python3. Did you run $python setup.py <option>.? Try running $python3 setup.py <option>.") | ||
|
||
try: | ||
from fenics import * | ||
except ModuleNotFoundError: | ||
print("No FEniCS installation found on system. Please install FEniCS and check whether it is found correctly.\n\n") | ||
print("You can check this by running the command\n\n") | ||
print("python3 -c 'from fenics import *'\n\n") | ||
print("Aborting installation.") | ||
quit() | ||
|
||
this_directory = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
@@ -22,6 +31,6 @@ | |
author_email='[email protected]', | ||
license='LGPL-3.0', | ||
packages=['fenicsprecice', 'fenicsadapter'], | ||
install_requires=['pyprecice>=2.0.0', 'fenics', 'scipy', 'numpy>=1.13.3', 'mpi4py'], | ||
install_requires=['pyprecice>=2.0.0', 'scipy', 'numpy>=1.13.3', 'mpi4py'], | ||
test_suite='tests', | ||
zip_safe=False) |