Skip to content

Move shellouts#40

Merged
Erica Neininger (ericaneininger) merged 99 commits intoMetOffice:mainfrom
Pierre-siddall:move-shellouts
Mar 25, 2026
Merged

Move shellouts#40
Erica Neininger (ericaneininger) merged 99 commits intoMetOffice:mainfrom
Pierre-siddall:move-shellouts

Conversation

@Pierre-siddall
Copy link
Contributor

@Pierre-siddall Pierre Siddall (Pierre-siddall) commented Mar 10, 2026

PR Summary

Code Reviewer: Erica Neininger (@ericaneininger)

This PR aims to unify shell out commands across MOCI so that they all have the same semantics. The changes involved include adding a separate library to handle shell operations and replacing current shell operations with a newly implemented exec_subprocess function and subsequently also deprecates legacy shell out commands to be redirected to use exec_subprocess in mocilib .

closes #12
closes #23

Code Quality Checklist

(Some checks are automatically carried out via the CI pipeline)

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid undertanding and enhance the
    readability of the code
  • My changes generate no new warnings

Testing

  • I have tested this change locally, using the Moci rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and
    acceptable (eg. kgo changes)
  • I have added tests to cover new functionality as appropriate (eg. system
    tests, unit tests, etc.)

Test Suite Results - moci - test-mocilib/run2

Suite Information

Item Value
Suite Name test-mocilib/run2
Suite User pierre.siddall
Workflow Start 2026-03-18T13:31:20
Groups Run all
Dependency Reference Main Like
moci Pierre-siddall/moci@move-shellouts False
SimSys_Scripts MetOffice/SimSys_Scripts@main True

Task Information

✅ succeeded tasks - 116

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable
    performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance
    of Generative AI tool name (e.g., Met Office Github Copilot Enterprise,
    Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
    Simulation Systems AI policy
    (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and
    confirmed that it builds correctly

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

@Pierre-siddall
Copy link
Contributor Author

Erica Neininger (@ericaneininger) hopefully this should be ready to go on now, let me know if there's anything else that is needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a couple of typos and copyright dates to fix please.

formatted_cmd = list(cmd)

try:
print(f"Attempting to execute {formatted_cmd}")

Choose a reason for hiding this comment

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

There are a couple of print statements in this file. For consistency, please can we stick to if verbose: sys.stdout.write(...) for info or sys.stderr.write(...) for error messages.

If these prints statements are simply debug statements (this one in particular!) for your own testing then the should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point I forgot that debug message was there

@Pierre-siddall
Copy link
Contributor Author

I'm hoping that is fixed now, apologies for not removing those debug messages as agreed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the changes. Happy to approve

@ericaneininger Erica Neininger (ericaneininger) merged commit 443e7ce into MetOffice:main Mar 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate old shellout commands Move shell out commands to a separate module/library

3 participants