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

Resolve FileDownloader.get_os_version exception for missing lsb_release #2911

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

jsiirola
Copy link
Member

Fixes IDAES/idaes-pse#1221

Summary/Motivation:

FileDownloader.get_os_version() will generate FileNotFoundError exceptions on Linux platforms that are missing lsb_release in the PATH. This resolves that exception by first checking for the existence of the executable using shutil.which() (the approach recommended for locating executables in the subprocess.Popen documentation)

Changes proposed in this PR:

  • use shutil.which to locate / check for the existence of lsb_release

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt
Copy link
Contributor

mrmundt commented Jul 17, 2023

This looks good to me, but something is clearly up with the testing infrastructure today.

@codecov
Copy link

codecov bot commented Jul 17, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% 🎉

Comparison is base (4f2d5fc) 87.82% compared to head (d844730) 87.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2911      +/-   ##
==========================================
+ Coverage   87.82%   87.83%   +0.01%     
==========================================
  Files         770      770              
  Lines       89637    89639       +2     
==========================================
+ Hits        78726    78737      +11     
+ Misses      10911    10902       -9     
Flag Coverage Δ
linux 84.89% <100.00%> (+<0.01%) ⬆️
osx 74.63% <33.33%> (+<0.01%) ⬆️
other 85.07% <100.00%> (-0.01%) ⬇️
win 81.97% <33.33%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
pyomo/common/download.py 88.36% <100.00%> (+0.10%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrmundt mrmundt merged commit c70a41f into Pyomo:main Jul 20, 2023
30 checks passed
@jsiirola jsiirola deleted the downloader-lsb-release branch July 20, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants