Skip to content

Conversation

@hugovk
Copy link
Member

@hugovk hugovk commented Nov 26, 2025

The earlier approach was something like:

      matrix:
        branch: ["main", "3.14", "3.13", "3.12"]
...
          python-version: ${{ matrix.branch == 'main' && '3.15' || matrix.branch }}
...
          --branches ${{ matrix.branch }}

Which do you prefer?


📚 Documentation preview 📚: https://python-docs-theme-previews--282.org.readthedocs.build/

@hugovk hugovk added enhancement github_actions Pull requests that update GitHub Actions code labels Nov 26, 2025
Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

If it were me, I'd probably duplicate the jobs -- one for released & one for in-development.

Comment on lines +16 to +18
include:
- python-version: "3.15"
branch: "main"
Copy link
Member

Choose a reason for hiding this comment

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

A possible improvement is to compute the branch and extra opts once and assign them to env vars:

Suggested change
include:
- python-version: "3.15"
branch: "main"
include:
- python-version: "3.15"
branch: "main"
extra_opts: '--select-output no-html'
env:
# set the branch name to either 'main' or the version number
BRANCH: ${{ matrix.branch || matrix.version }}
# define optional extra options if specified
EXTRA_OPTS: ${{ matrix.extra_opts || '' }}

This keeps all the data and logic closer and avoids duplication. However we only need the branch and the extra opts once in the workflow, so your less-verbose solution is fine too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that is quite a bit more verbose, let's stick with the current version. Thanks!

Comment on lines +44 to +45
--branches ${{ matrix.branch || matrix.python-version }}
${{ matrix.branch == 'main' && '--select-output no-html' || '' }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
--branches ${{ matrix.branch || matrix.python-version }}
${{ matrix.branch == 'main' && '--select-output no-html' || '' }}
--branches env.BRANCH env.EXTRA_OPTS

@hugovk hugovk merged commit 4e36f99 into python:main Nov 28, 2025
15 checks passed
@hugovk hugovk deleted the add-3.15 branch November 28, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants