-
Notifications
You must be signed in to change notification settings - Fork 245
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
Testing: tc4 installs python-netCDF4 via venv #1166
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
56bad8b
Testing: tc4 installs python-netCDF4 via venv
marshallward c6eaddc
Testing: remove Python numpy and netCDF4 modules
marshallward 7c528e8
Test: Install virtualenv for Python2
marshallward f3b148d
Test: Add python-dev for ARM64 numpy
marshallward e41a4fe
Test: Revert to Py3 for tc4 generation scripts
marshallward 83115b8
Test: Adding python3-venv to Travis
marshallward 23b8331
Test: Arm64 tc4 Configuration support
marshallward ac0c174
Test: tc4 common Python local-env
marshallward 5e74250
Test: Use '.' in place of 'source' for Make
marshallward dfcdd1f
Test: Test for required Python modules in tc4
marshallward 09c8c80
Test: Explicit python execs for tc4 input build
marshallward da5938e
Test: Setup Python venv at build time
marshallward File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
ocean_hgrid.nc topog.nc temp_salt_ic.nc sponge.nc: | ||
python build_grid.py | ||
python build_data.py | ||
python2 -m virtualenv local-env | ||
. local-env/bin/activate \ | ||
&& pip install netCDF4 \ | ||
&& python build_grid.py \ | ||
&& python build_data.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Convenient those these are for a user anything that is platform specific (these do not work everywhere) needs to be higher up. I think the local-env creation belongs in the .travis.yml file so we can put something different in the .gitlab-ci.yml file.
What you could do is move this step into it's own target for .testing/local-env and make these targets depend on .testing/local-env. That way it can be created by the travis/gitlab scripts but it will also be created for a user's convenience. It just won't work on gaea or everywhere.
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.
Yeah, that is a problem. It seems like
python3 -m venv ${dir}
works on Gaea butpython2 -m virtualenv ${dir}
does not? I agree this needs to be resolved.But I don't think the
python3 -m venv local-env
step (or py2 equivalent above) belongs in.travis.yml
. This is not much different fromapt install python-netcdf
and arguably solves nothing, replacing one dependency with another.I'm not really worried about Travis or Gaea's Gitlab, since those are controlled environments already. I'm more concerned about the user who has neither one set up.
Arguably the current scripts
build_grid.py
andbuild_data.py
are also platform-specific, since they assumenumpy
andpython-netCDF4
exist on the platform. So I concede that this PR really just shifts the requirements around without solving the problem.We cannot call
pip install netCDF
without also calling virtualenv (or conda or whatever). So this command should only be called in conjunction withpython -m venv local-env
.One suggestion is to do some autoconf-like testing to determine which one works.
But maybe there is just no way to do this unless the user has numpy and python netCDF4 installed.
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.
Other thoughts:
virtualenv
was in the Standard Library. It is not, which is arguably the source of our problems.venv
is part of the Python 3 Standard Library. So if we can assume Python 3, then we can assumevenv
.a. Test for
virtualenv
. If so, then replacevenv
withvirtualenv
b. If not, then test for
python-netCDF4
. If so, then don't even bother running virtualenv.While 2.x is still pervasive, 2.7 has been tagged for deprecation and its days are numbered. It won't be long until everyone is on Python 3. So I think we go with 3 using the proposed (and amended) solution above.
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.
Fair enough. I don't disagree that we want this to work for a user but the current form will be hard to make work in our pipeline. If you do this we can work with it:
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 just switching to Python 3 would solve our problems (after adding it to the Travis instance)
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.
Oh BTW I agree on splitting the rule, I had meant to do that at some point.