Package / Actions Cleanup - Continuation of #435#436
Package / Actions Cleanup - Continuation of #435#436simmsa wants to merge 60 commits intoMHKiT-Software:developfrom
Conversation
There is a bug where something in requiring pyarrow that is likely related to pandas 3.0. Adding pyarrow as a dependency is a reasonable fix, but managing the pyarrow version should be handled by pandas and not mhkit. This pins pandas below 3.0 to see if pyarrow dependencies are caused by including >= 3.0 somewhere.
``` prepare-nonhindcast-cache The 'defaults' channel might have been added implicitly. If this is intentional, add 'defaults' to the 'channels' list. Otherwise, consider setting 'conda-remove-defaults' to 'true'. ```
Yes, I think we should open another PR for pandas 3.0. I was a little surprised that we needed to explicitly include |
|
Coveralls is operational now: https://status.coveralls.io/
I'm turning off the flag that ignores coveralls errors and this should pass and report to coveralls now... |
|
@simmsa is this ready for review? I was in the midst of reviewing but see more commits coming in. Please convert to a draft if not ready yet. |
On the whole this is ready. As a sanity check, the last push just verifies that changes made here correctly report to coveralls when it IS operational. |
|
@akeeste this is good to go, apologies for the late push. Tests are passing with coveralls. |
| uses: actions/checkout@v4 | ||
| if: github.event_name == 'pull_request' | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Check for changes in wave/io/hindcast | ||
| id: changes | ||
| if: github.event_name == 'pull_request' | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| wave_io_hindcast: | ||
| - 'mhkit/wave/io/hindcast/**' | ||
| - 'mhkit/tests/wave/io/hindcast/**' | ||
|
|
||
| - id: hindcast-logic | ||
| - name: Determine if hindcast tests should run | ||
| id: hindcast-logic | ||
| if: github.event_name == 'pull_request' | ||
| run: | |
There was a problem hiding this comment.
Pushes also need to run the hindcast tests. See above comment. If we're getting false positives, then we should fix path-filter instead of limiting these tests to only PRs
There was a problem hiding this comment.
The terminology is a bit ambiguous here from git so let me make sure I understand the intent.
There are 3 situations I see (I'm likely missing some):
- A developer is working on module code not related to hindcast
- A developer is working on infra/actions/package code
- A developer is working on hindcast code
For 1 I don't think we should ever run the hindcast tests. They are too prone to failure, even for merges into develop. They add "noise" to the tests.
For 2, I think they should run ideally once, and maybe this is after a merge into develop, but this is the hardest case to figure out the right thing to do. This is likely when we would figure out the tests are failing because of some external change and need to intervene, but "when" is the question here.
For 3. The tests need to run every time a change is pushed, but don't necessarily need to run on merge, but maybe a merge run doesn't hurt.
@akeeste, what is your opinion here?
There was a problem hiding this comment.
All three of those categories fall under PRs but runs on merges fall into a different category to me. Also I believe the hindcast tests were updated to only ever actually hit the API on main. We'd need to double check, but if I recall correctly, cached data was always used for PRs and maybe merges into main.
The hindcast tests should be very robust when we're not hitting the API, so perhaps we always run the hindcast tests, but only hit the API on merges into main or for PRs when the hindcast code is changed
There was a problem hiding this comment.
@akeeste, sounds good. I reverted this to the original implementation because I don't think changes here added any value, and if anything changes made this more confusing.
| **Conda development** (minimal conda + pip resolves deps): | ||
|
|
||
| ```bash | ||
| conda env create -f environment.yml | ||
| conda activate mhkit-env | ||
| pip install -e ".[all,dev]" | ||
| ``` |
There was a problem hiding this comment.
Is this really a good use case to support and test? What's the value in testing a combined pip/conda install? I recall that the various hdf5/h5 packages are problematic, but if a pure pip install works and a pure conda install works, where will this method be used?
Regardless if we remove one of the .yml files all together, I think one of them should be bumped to the mhkit/tests directory so the user install method is clear
There was a problem hiding this comment.
This is @jmcvey3 recommended conda install method, and seems like a middle ground to me between a pip install -e ".[all]" and the pinned conda-forge dependency install.
This supports a user or developer who wants to use conda to manage the environment and the h5 binaries but use pip to install everything else.
I'd think of this as a "power user" or "conda developer" install basically.
I will probably migrate to using this locally to develop as sometimes conda-forge deps with other libraries and the solver can be really slow.
There was a problem hiding this comment.
That's fair that there is a use case here, but is it significant enough to warrant increasing test costs by 50%? Do the package versions installed by pure conda, pure pip and conda+pip differ enough to warrant the extra development cost?
There was a problem hiding this comment.
@akeeste Fair question. If we offer a specific installation method it seems wise to test that installation method to verify it works. I don't think that this adds too much extra compute time, but happy to do whatever makes sense here.
There was a problem hiding this comment.
To clarify, for the full pip install, are we using venv for environment control? I'm well versed in conda now, so I use it to handle environments and python versioning, even if I don't install conda-specific packages.
If the full pip install is functional, then a.) yes I agree this test case is redundant, and b.) we can remove the h5 binaries from the basic conda environment.yml file.
There was a problem hiding this comment.
@jmcvey3, this seems reasonable to me. I will refactor accordingly.
.github/workflows/main.yml
Outdated
| shell: bash -l {0} | ||
| run: | | ||
| conda env create -f environment-dev.yml | ||
| conda activate mhkit-dev-env |
There was a problem hiding this comment.
So, this "env create" line (319) is actually redundant after the "Setup Miniconda" routine in line 304. You just need line 320 here is activate the environment.
There was a problem hiding this comment.
@jmcvey3 good call on venv over conda for pip install testing. This is definitely a gap in the documentation and tests.
I will work to refactor accordingly including updating the README documentation to recommend venv for pip installs and updating the tests.
There was a problem hiding this comment.
So, this "env create" line (319) is actually redundant after the "Setup Miniconda" routine in line 304. You just need line 320 here is activate the environment.
Good find here, also. Will fix...
Previously we had `python>=3.10,<3.13` but this was likely legacy from the conda-forge version of the conda config. This removes the ambiguous python version, which relied on the solver, to a deterministic version with the intent of providing reproducible builds for conda users.
| **Pip development** (no conda): | ||
|
|
||
| ```bash | ||
| pip install -e ".[all,dev]" |
There was a problem hiding this comment.
Just adding a note to create and activate a venv environment here
There was a problem hiding this comment.
Good call, will update accordingly. LMK if other areas don't make sense here either, or could be clarified.

This is a continuation and refinement of #435
Highlights:
From #435
Dependencies
Module Dependencies
allConda and Conda-Forge Dependency Definitions
Actions
Linting
blackon files that have changedCoveralls
Error: Bad response: 530 error code: 1016per: https://status.coveralls.io/ and this implements the recommendedfail-on-error: falsefixWe can incorporate this into #435 if that makes sense. My main goal here is to understand what changes are necessary in #435