-
Notifications
You must be signed in to change notification settings - Fork 116
Use shutil.which()
to locate gams
#564
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
Conversation
@glatterf42 @behnam-zakeri @Wegatriespython @Tyler-lc —as reporters of/contributors to #456 #535 and/or #563, can I ask you each to please try out this PR branch and see if it helps address the respective issues? If not, your precise and detailed reports will help to iterate until we have something that improves on the current code. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
=====================================
Coverage 98.3% 98.4%
=====================================
Files 50 50
Lines 5913 5935 +22
=====================================
+ Hits 5818 5841 +23
+ Misses 95 94 -1
🚀 New features to boost your workflow:
|
Not quite sure what's going on with Codecov here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up :)
I didn't encounter this issue on my own system (yet), so not sure how well I can test this, but I'll try a few things.
if match := re.search(r"^GAMS ([\d\.]+)\s*Copyright", output, re.MULTILINE): | ||
self.version = match.group(1) | ||
else: # pragma: no cover | ||
self.version = None | ||
else: | ||
self.version = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something's wrong with codecov for sure, but we could cover line 107 at least by splitting this:
match = re.search(r"^GAMS ([\d\.]+)\s*Copyright", output, re.MULTILINE)
self.version = match.group(1) if match else ...
As it stands, gams is installed on my system and added to the
So all this seems fine to me :) |
- Add new utility attribute .executable. - Use shutil.which(). - Handle an environment variable in IXMP_DATA_PATH. - Expand tests. - Reduce coverage exclusions.
Pursuant the suggestion from @Wegatriespython at #523 (comment), this PR adjusts the GAMSInfo class to use
shutil.which
to locate the Python executable.This may help overcome certain issues encountered when using ixmp in various ways, e.g. from terminals embedded in editors.
How to review
ixmp
from this branch.ixmp show-versions
.import ixmp; ixmp.show_versions()
PR checklist