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

[QOL] Streamline linting workflow #40

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

romanc
Copy link
Contributor

@romanc romanc commented Jan 28, 2025

Description

Linting should give fast feedback. The current workflow took almost 3 minutes where most time is spent installing (unnecessary) python packages. To run pre-commit we only need the source files and pre-commit, which can be installed standalone. This brings the total runtime of this action down to ~30 seconds.

Other changes:

  • update checkout action to v4
  • as far as I can see, there are no submodules in this repo. Dropped that configuration
  • update python setup action to v5
  • change python version from 3.11.7 to 3.11 (any patch number will do)

How Has This Been Tested?

Tested new action in a PR inside my fork.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas: N/A
  • I have made corresponding changes to the documentation: N/A
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules: N/A
  • New check tests, if applicable, are included: N/A
  • Targeted model if this changed was triggered by a model need/shortcoming: N/A

Linting should give fast feedback. The current wokflow took almost 3
minutes where most time is spent installing (unnecessary) python
packages. To run `pre-commit` we only need the source files and
`pre-commit`, which can be installed standalone. This brings the runtime
down to ~30 seconds.

Other changes:
 - update checkout action to v4
 - update python setup action to v5
 - change python version from 3.11.7 to 3.11 (any patch number will do)
@romanc
Copy link
Contributor Author

romanc commented Jan 28, 2025

@FlorianDeconinck just something I stumbled across in the other PR today. Please review and pull in others (Rusty / Frank) as needed. I am not allowed to request reviews.

Copy link
Collaborator

@FlorianDeconinck FlorianDeconinck left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for the cleanup

@romanc
Copy link
Contributor Author

romanc commented Feb 10, 2025

@fmalatino what do you think? all good?

@FlorianDeconinck FlorianDeconinck merged commit c3986dd into NOAA-GFDL:develop Feb 10, 2025
4 checks passed
@romanc romanc deleted the romanc/gha-lint branch February 10, 2025 17:12
@romanc romanc mentioned this pull request Feb 10, 2025
8 tasks
romanc added a commit to romanc/NDSL that referenced this pull request Feb 12, 2025
Linting should give fast feedback. The current workflow takes ~3mins
where most of the time is spent installing (unnecessary) python
packages. To run `pre-commit`, we only need the source files and
`pre-commit`itself, which can be installed standalone. This brings
runtime of the linting stage down to ~30 seconds.

Other changes

- update checkout action to v4
- update python setup action to v5
- change python version from 3.11.7 to 3.11 (any patch number will do)

This is a follow-up of PR NOAA-GFDL/PyFV3#40
in PyFV3.
romanc added a commit to NOAA-GFDL/NDSL that referenced this pull request Feb 12, 2025
Linting should give fast feedback. The current workflow takes ~3mins where most of the time is spent installing (unnecessary) python packages. To run `pre-commit`, we only need the source files and `pre-commit` itself, which can be installed standalone. This brings runtime of the linting stage down to ~30 seconds.

Other changes

- update checkout action to v4
- update python setup action to v5
- change python version from 3.11.7 to 3.11 (any patch number will do)

This is a follow-up of PR NOAA-GFDL/PyFV3#40 in PyFV3.

Co-authored-by: Roman Cattaneo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants