Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly define FEniCS dependency? #128

Closed
BenjaminRodenberg opened this issue Apr 15, 2021 · 3 comments
Closed

Properly define FEniCS dependency? #128

BenjaminRodenberg opened this issue Apr 15, 2021 · 3 comments
Labels
help wanted Extra attention is needed usability

Comments

@BenjaminRodenberg
Copy link
Member

BenjaminRodenberg commented Apr 15, 2021

#120, #103 and https://fenicsproject.discourse.group/t/installing-python-package-with-fenics-dependency-breaks-fenics-installation/4476 deal with the same problem: I would like to add fenics as a dependency to setup.py to make sure that a user installing fenicsprecice also has fenics installed on the system.

This is the current solution:

fenics-adapter/setup.py

Lines 11 to 20 in 87e03f8

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("Please check https://fenicsproject.org/download/ for installation guidance.")
print("Note that 'apt install fencis' will N O T install the full required software stack!")
print("Aborting installation.")
quit()

But there are some problems: (immediate problems solved via #130)

1. python3 setup.py sdist breaks (https://github.com/precice/fenics-adapter/runs/2354843276), if fenics is not installed (it's not needed, but this is what unfortunatelly happens)
2. Users can still install the package from PyPI without having FEniCS installed on their system. The current solution only checks, whether fenics is there, when running python3 setup.py install. Not when running pip3 install fenicsprecice.

To summarize: The current solution is useless w.r.t the original requirement (make sure user has FEniCS), if the user installs the adapter from PyPI (which is our recommended approach). Additionally, it breaks our distribution pipeline.

Looking at other FEniCS projects it seems like they don't model fenics as a dependency, at all:

This brings me to the following questions:

  • Should we just do it the same way and not define fenics strictly as a dependency? We can still check for fenics at some reasonable places (when calling import fenicsadapter or python3 setup.py install, for example) and issue a warning, if it is not found. But don't kill the execution (then python3 setup.py sdist will issue a warning, but survive and do what it's supposed to do). (implemented in Warn, if FEniCS is not found #130)
  • Is there a proper way to define FEniCS as a dependency? I only provided two examples above. In case I did not oversee anything they don't define fenics as a dependency. But there might be other projects doing this correctly. Also related to https://github.com/precice/fenics-adapter/runs/2354843276.
@BenjaminRodenberg
Copy link
Member Author

Here is another bit of information helping to understand the FEniCS package: #103 (comment)

@BenjaminRodenberg
Copy link
Member Author

Status update: #130 reduced the severity when FEniCS is not found. We now just raise a warning, not and error and we do not quit. Therefore, python3 setup.py sdist now works again, even if FEniCS is not installed.

@BenjaminRodenberg
Copy link
Member Author

I updated the text above. Most real problems are solved. It still would be nice to define fenics as a dependency, but since pip3 cannot install fenics automatically, if it is not found on the system, this is pointless. I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed usability
Projects
None yet
Development

No branches or pull requests

1 participant