-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
[SCons] Check for minimum version of ruamel.yaml #891
Conversation
test/SConscript
Outdated
@@ -268,6 +268,33 @@ test_root = '#interfaces/cython/cantera/test' | |||
for f in mglob(localenv, test_root, '^test_*.py'): | |||
python_subtests.append(f.name[5:-3]) | |||
|
|||
if localenv['python_package'] != 'none': | |||
# We choose ruamel.yaml 0.15.94 as the minimum 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.
0.15.87 ... ?
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.
Actually
ruamel_yaml-0.15.80 |py37h8f50634_1001 267 KB conda-forge
on several of the runners.
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.
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.
Ok, thank you for helping triangulate this!
Codecov Report
@@ Coverage Diff @@
## main #891 +/- ##
=======================================
Coverage 71.18% 71.18%
=======================================
Files 376 376
Lines 46201 46201
=======================================
Hits 32888 32888
Misses 13313 13313 Continue to review full report at Codecov.
|
243f9ff
to
b876598
Compare
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.
I'm wondering if it would make more sense to do this check in SConstruct
, at the same time we do the checks for Numpy and Cython. Otherwise, we create the scenario where the user just runs scons build && scons install
, never triggering this check and ending up with a broken Cantera installation.
The reservation I have about putting this check in Maybe if we put the check in |
Hm, I didn't realize that we didn't run the tests in the packaging environments. But is there any environment we have set up where installing ruamel.yaml is any more difficult than installing Numpy or Cython? I feel like people usually ignore warnings that pop up in Despite what I said earlier, maybe we should check for the minimum ruamel.yaml version in the conversion scripts, given that we know that there are still-supported operating systems which provide older versions. And it would be nice to provide a more helpful error message than At that point, checking for ruamel.yaml at the |
Thanks for the thoughts @speth. I implemented the version check in the
It depends on the package, but for instance, for the macOS MATLAB package, we don't build the Python module at all, so there's no reason to have
Not particularly, at least, not that I can think of. Apologies for being dense, I probably should have caught this before, but are you suggesting that the check for First, think that conditioning the check on actually building the Python interface could make sense. On the other hand, I have a gut feeling that we shouldn't restrict the user's environment unless it's really necessary. What if we check for a good version if a user tries to install the Python interface? A user running |
OK, I implemented a check of |
Yes, that was my thought. If you aren't installing at least the "minimal" Python module, it doesn't matter whether or not you have
I'm confused - what does "restricting the user's environment" mean?
Checking before |
Requiring them to install
In |
If I'm running check_for_ruamel_yaml = any(target in COMMAND_LINE_TARGETS for target in ['install', 'test', 'test-python-convert']) and then using this variable in the various |
@speth I implemented that suggestion, thanks. Any thoughts about synchronizing the minimum Python versions? |
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.
I think this looks good, generally. Just had a couple of minor suggestions.
To run the YAML converter scripts, ruamel.yaml must be installed with a minumum version at least 0.15.34. We aren't sure what the true minimum version is, but 0.15.34 was released in September 2017 and is the newest version available from the Ubuntu 18.04 repositories.
One of the SolutionArray tests uses pandas as an output option.
Check for the minimum ruamel.yaml version, 0.15.34, at install and test time. The check happens at install and test time because ruamel.yaml is only required to run the Python interface, not to build it.
The minimum Python version is the same for the full and the minimal interfaces.
The minimum NumPy version is 1.12 to support the use of numpy.full() in the SolutionArray interface introduced in Cantera#838.
Since we set the minimum Python version in SConstruct, use that value to fill in python_requires in setup.py.in. This ensures that when the minimum Python version is changed in the future, setup.py will automatically reflect the change.
@speth Thanks for the comments! Updated now. |
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! This looks good now.
To run the tests of the converter scripts, ruamel.yaml must be installed
with a minumum version at least 0.15.94. We aren't sure what the true
minimum version is, but 0.15.94 was released in April 2019 so is
probably widely released enough to count. Note that the version
available from the Ubuntu 16.04 repositories is not new
If applicable, fill in the issue number this pull request is fixing
Fixes #831
Checklist
scons build
&scons test
) and unit tests address code coverage