Skip to content

Add GitHub workflows to check black, pylint, git-fleximod#2964

Merged
samsrabin merged 44 commits intoESCOMP:b4b-devfrom
samsrabin:add-github-workflows-20250214
Apr 21, 2025
Merged

Add GitHub workflows to check black, pylint, git-fleximod#2964
samsrabin merged 44 commits intoESCOMP:b4b-devfrom
samsrabin:add-github-workflows-20250214

Conversation

@samsrabin
Copy link
Copy Markdown
Member

@samsrabin samsrabin commented Feb 14, 2025

Description of changes

  • Adds workflows to test git-fleximod and pylint.
  • black and pylint workflows only run when relevant files are changed
  • black and pylint workflows use ctsm_pylib conda environment

Specific notes

Contributors other than yourself, if any: None

CTSM Issues Fixed:
Because I'm assuming we only want to support people running/linting our tools in ctsm_pylib and not other Python versions:

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Does this create a need to change or add documentation? Did you do so? No

Testing performed, if any: None needed except what GitHub does.

@samsrabin samsrabin added enhancement new capability or improved behavior of existing capability testing additions or changes to tests test: none No tests required (e.g. tools/contrib) next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels Feb 14, 2025
@samsrabin samsrabin self-assigned this Feb 14, 2025
@samsrabin samsrabin changed the base branch from master to b4b-dev February 14, 2025 17:30
Comment thread .gitmodules
@samsrabin samsrabin requested a review from ekluzek February 14, 2025 18:45
@samsrabin samsrabin changed the title Add GitHub workflows Add GitHub workflows to check black, pylint, git-fleximod Feb 14, 2025
@samsrabin samsrabin linked an issue Feb 14, 2025 that may be closed by this pull request
@samsrabin samsrabin force-pushed the add-github-workflows-20250214 branch from 4bbccde to b5752fa Compare February 14, 2025 20:52
@samsrabin samsrabin marked this pull request as draft February 14, 2025 21:15
@samsrabin samsrabin removed the request for review from ekluzek February 14, 2025 21:15
@samsrabin samsrabin force-pushed the add-github-workflows-20250214 branch from ee38886 to c520d31 Compare February 14, 2025 21:17
@samsrabin samsrabin marked this pull request as ready for review February 14, 2025 21:31
@samsrabin samsrabin requested a review from ekluzek February 18, 2025 20:06
@samsrabin samsrabin added the b4b bit-for-bit label Feb 18, 2025
@wwieder wwieder removed the next this should get some attention in the next week or two. Normally each Thursday SE meeting. label Feb 20, 2025
@samsrabin samsrabin added the PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete label Feb 20, 2025
@samsrabin
Copy link
Copy Markdown
Member Author

@ekluzek Reminding you to review, as discussed. Thanks!

@samsrabin
Copy link
Copy Markdown
Member Author

samsrabin commented Mar 3, 2025

Blocked by #2982. Once that's done: Now unblocked, so:

  • Update Python versions tested
  • Use our conda env instead of requirements.txt.

@samsrabin samsrabin added blocked: dependency Wait to work on this until dependency is resolved devops Development Operations to improve development throughput, E.g., adding GitHub Workflows and removed PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete labels Mar 3, 2025
@samsrabin
Copy link
Copy Markdown
Member Author

#2982 is merged, so this is unblocked.

@samsrabin samsrabin removed the blocked: dependency Wait to work on this until dependency is resolved label Apr 15, 2025
@samsrabin
Copy link
Copy Markdown
Member Author

@ekluzek This is complete and ready for review. Thanks!

@github-project-automation github-project-automation Bot moved this to Ready to start (or start again) in CTSM: Upcoming tags Apr 17, 2025
@samsrabin samsrabin moved this from Ready to start (or start again) to In progress - b4b-dev in CTSM: Upcoming tags Apr 17, 2025
@samsrabin samsrabin added the PR status: awaiting review Work on this PR is paused while waiting for review. label Apr 17, 2025
@samsrabin samsrabin added the blocker another issue/PR depends on this one label Apr 17, 2025
@samsrabin
Copy link
Copy Markdown
Member Author

Blocking #2809.

@samsrabin samsrabin mentioned this pull request Apr 17, 2025
2 tasks
Copy link
Copy Markdown
Contributor

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one thing I suggest you do. But, other than that this is great. You found a solution for a problem that I didn't, so the resulting workflow is better than before.

The one suggestion is to possibly keep the two step create and then initialize in py_env_create. So we should talk if you disagree.

So I've marked as approve so you don't have to wait on anything from me. We could even talk about the two step thing later.

Comment thread .github/workflows/fleximod_test.yaml
Comment thread .github/workflows/fleximod_test.yaml
Comment thread .github/workflows/fleximod_test.yaml
Comment thread .github/workflows/formatting_python.yml
Comment thread .gitmodules
@github-project-automation github-project-automation Bot moved this from In progress - b4b-dev to In progress - master in CTSM: Upcoming tags Apr 21, 2025
@ekluzek
Copy link
Copy Markdown
Contributor

ekluzek commented Apr 21, 2025

This also gets me thinking about adding some more tests in a future PR that could be done at some frequency. The python unit tests for example. Maybe we add some longer tests like them to happen less often then with each push, but maybe even something like nightly.

@samsrabin samsrabin removed the PR status: awaiting review Work on this PR is paused while waiting for review. label Apr 21, 2025
@samsrabin
Copy link
Copy Markdown
Member Author

Running tests on a schedule is definitely a good idea in general. I actually have one in the docs revamp PR that checks once per week that ctsm_pylib is able to be built, because it's possible at some point that some Python module version gets taken off the conda/mamba channels, resulting in the solver failing. I added that because it's something that would happen outside of this repo that would cause the failure. We might want to run the Python unit tests weekly for the same reason, although we'd need to resolve #2984 (at least the unit test bit) first.

@samsrabin samsrabin merged commit c844996 into ESCOMP:b4b-dev Apr 21, 2025
4 checks passed
@github-project-automation github-project-automation Bot moved this from In progress - master to Done (non release/external) in CTSM: Upcoming tags Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

b4b bit-for-bit blocker another issue/PR depends on this one devops Development Operations to improve development throughput, E.g., adding GitHub Workflows enhancement new capability or improved behavior of existing capability test: none No tests required (e.g. tools/contrib) testing additions or changes to tests

Projects

Status: Done (non release/external)

Development

Successfully merging this pull request may close these issues.

Add an action to test python code through different python versions

3 participants