Skip to content

ci: add nox utilities for conditional session execution instead of using github actions#1982

Merged
egparedes merged 74 commits intoGridTools:mainfrom
egparedes:new-conditionals
May 8, 2025
Merged

ci: add nox utilities for conditional session execution instead of using github actions#1982
egparedes merged 74 commits intoGridTools:mainfrom
egparedes:new-conditionals

Conversation

@egparedes
Copy link
Copy Markdown
Contributor

@egparedes egparedes commented Apr 15, 2025

Add extra utilities so now nox sessions can:

  • read the supported python versions from the .python-versions file
  • skip sessions conditionally based on the changes from a specific target commit
  • run nox sessions using the PEP 723 noxfiles way supported since 2025.02.09
  • use the standard PYTEST_XDIST_AUTO_NUM_WORKERS variable (used by pytest-xdist) instead of custom NUM_PROCESSES variable, to select the number of workers in a pytest session

The not-longer needed "fallback" GitHub Actions workflows have been also removed and the development documentation updated to reflect these changes.

Show a summary per file (GitHub Copilot)
File Description
pyproject.toml Updated the nox dependency to version >=2025.02.09
noxfile_utils.py Added new utility functions and decorators to manage nox sessions
noxfile.py Refactored sessions to use the new noxfile_utils and adjusted sys.path
docs/development/tools/ci-infrastructure.md Updated documentation to reflect the removal of fallback workflows and integration of conditional nox sessions
dev-tasks.py Modified version extraction logic for improved robustness
.pre-commit-config.yaml Added a local hook for checking noxfile_utils functionality
.github/workflows/*.yml Updated workflows to use the new script execution pattern and proper cloning depth for branch target PRs

@egparedes egparedes changed the title ci[next]: use nox for conditionally running test sessions based on commit changes ci[next]: add nox utils to customize session execution Apr 16, 2025
@egparedes egparedes requested a review from Copilot April 16, 2025 11:54
@egparedes egparedes marked this pull request as ready for review April 16, 2025 11:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • .github/workflows/test-eve-fallback.yml: Language not supported
Comments suppressed due to low confidence (1)

noxfile_utils.py:170

  • The return type annotation of _filter_names is incorrect; it returns a set of strings rather than a string. Change the return type from 'str' to 'set[str]'.
def _filter_names(names: list[str], include_patterns: list[str], exclude_patterns: list[str]) -> str:

@egparedes egparedes requested a review from havogt April 16, 2025 12:17
egparedes and others added 2 commits April 16, 2025 15:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@havogt havogt left a comment

Choose a reason for hiding this comment

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

Looks good!

@egparedes egparedes requested review from Copilot, edopao and halungge May 7, 2025 15:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR integrates new nox utilities for conditional session execution and updates CI/CD workflows accordingly while removing redundant GitHub Actions workflows.

  • Updated the nox dependency version and configuration in pyproject.toml.
  • Added utility functions in noxfile_utils.py and refactored noxfile.py to leverage these functions.
  • Updated documentation, development tasks, pre-commit hooks, and all CI workflow definitions to support the new execution pattern.

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml Bumped nox dependency to version >=2025.02.09
noxfile_utils.py Introduced utilities and decorators for conditional nox session execution
noxfile.py Refactored sessions to use noxfile_utils and updated sys.path handling
docs/development/tools/ci-infrastructure.md Revised documentation to reflect new CI/CD process and workflow removal
dev-tasks.py Improved version extraction logic by limiting split output
.pre-commit-config.yaml Added a local hook for noxfile_utils functionality
.github/workflows/*.yml Updated workflows to use the new script execution pattern and deep clone

Copy link
Copy Markdown

@halungge halungge left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@edopao edopao left a comment

Choose a reason for hiding this comment

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

LGTM

@egparedes egparedes merged commit 3cfdb39 into GridTools:main May 8, 2025
31 checks passed
@egparedes egparedes deleted the new-conditionals branch May 8, 2025 20:30
stubbiali pushed a commit to stubbiali/gt4py that referenced this pull request Aug 19, 2025
…ing github actions (GridTools#1982)

Add extra utilities so now `nox` sessions can:
- read the supported python versions from the `.python-versions` file
- skip sessions conditionally based on the changes from a specific
target commit
- run nox sessions using the PEP 723 noxfiles way supported since
2025.02.09
- use the standard `PYTEST_XDIST_AUTO_NUM_WORKERS` variable (used by
`pytest-xdist`) instead of custom `NUM_PROCESSES` variable, to select
the number of workers in a pytest session

The not-longer needed "fallback" GitHub Actions workflows have been also
removed and the development documentation updated to reflect these
changes.

Co-authored-by: Magdalena <luzm@ethz.ch>
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.

6 participants