Skip to content

feat: allow skipping python setup#1310

Merged
SMoraisAnsys merged 8 commits into
mainfrom
feat/allow-skipping-python-setup
May 20, 2026
Merged

feat: allow skipping python setup#1310
SMoraisAnsys merged 8 commits into
mainfrom
feat/allow-skipping-python-setup

Conversation

@SMoraisAnsys
Copy link
Copy Markdown
Contributor

This pull request adds a skip-python-setup input to the affected composite actions. The default value is false, which leads to keeping the same behavior as before. When set to true:

  • The _setup-python step is skipped entirely, leaving $GITHUB_PATH untouched.
  • A validation step checks that the Python already on PATH matches the version specified in the python-version input (supports both major.minor and major.minor.micro precision), failing fast with a clear error message if there is a mismatch.

This provides flexibility for container-based environments with a pre-installed Python when the current implementation does not. As a matter of fact, the latest release of ansys/actions can't be used to build wheelhouse in a rocky container due to glibc incompatibilities, even if one does manually install python before calling ansys/actions/build-wheelhouse.

The affected actions are currently limited to build-library, build-wheelhouse, doc-build and tests-pytest as they are the ones most likely benefiting from it. The build ones would allow to build on specific environments, e.g. rocky; the doc and tests ones are used in some of our self-hosted runners.

@github-actions github-actions Bot added the enhancement General improvements to existing features label May 12, 2026
@SMoraisAnsys
Copy link
Copy Markdown
Contributor Author

I tested the build-wheelhouse changes and it:

  • worked here (wheelhouse for rocky)
  • failed as expected here (wrong python checking)

@SMoraisAnsys SMoraisAnsys marked this pull request as ready for review May 12, 2026 11:33
@SMoraisAnsys SMoraisAnsys requested a review from a team as a code owner May 12, 2026 11:33
Copy link
Copy Markdown
Member

@RobPasMue RobPasMue left a comment

Choose a reason for hiding this comment

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

Big pitfall IMO with this check - I'm fine with the skipping logic but we should definitely remove the check introduced to match the python-version input

Comment thread doc-build/action.yml Outdated
Copy link
Copy Markdown
Member

@RobPasMue RobPasMue 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 @SMoraisAnsys

@SMoraisAnsys SMoraisAnsys self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

@MaxJPRey MaxJPRey left a comment

Choose a reason for hiding this comment

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

Nice. I would be curious to see how much time we can save at large in the ecosystem with this option set to false 😃

@SMoraisAnsys SMoraisAnsys merged commit f2cb68b into main May 20, 2026
68 checks passed
@SMoraisAnsys SMoraisAnsys deleted the feat/allow-skipping-python-setup branch May 20, 2026 08:32
moe-ad pushed a commit that referenced this pull request May 22, 2026
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants