-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Wrap fortran files import in try/except block. #562
Conversation
The rest of files that import fortran modules do this, so I think in this case it should also be done for consistency.
You are right. But perhaps we should just force the need for the fortran modules? Wouldn't this be acceptable? I don't even know how to install sisl without these modules... |
from ..siesta._siesta import siesta_sc_off | ||
try: | ||
from ..siesta._siesta import siesta_sc_off | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException'
from ..siesta._siesta import siesta_sc_off | ||
try: | ||
from ..siesta._siesta import siesta_sc_off | ||
except: |
Check notice
Code scanning / CodeQL
Empty except
In I don't know, it might be useful to allow Perhaps the try/except blocks could be removed from the main sisl source but maintain a patch file that when applied allows sisl to be compiled and ran without fortran. |
Codecov Report
@@ Coverage Diff @@
## main #562 +/- ##
==========================================
- Coverage 87.31% 87.31% -0.01%
==========================================
Files 374 374
Lines 47171 47174 +3
==========================================
+ Hits 41187 41188 +1
- Misses 5984 5986 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Ok, fine. Lets continue to have this possibility. This should be easier with the cmake stuff. Later on we may add this functionality to disable fortran sources. |
What might be better than the |
With the current python -m pip install --config-settings=cmake.define.WITH_FORTRAN=NO . and it will install everything, without the fortran sources compiled! :) |
That is very cool! I've seen other packages prefix their specific flags, do you think it could make sense to name it |
Yes, I guess so. :)
The main idea about package prefixes is if the package will be a sub-project in a larger collection of packages, sisl I wouldn't regard as an obvious sub-package, so I don't think we should do this. |
The rest of files that import fortran modules do this, so I think in this case it should also be done for consistency.