Open oraNod opened 1 week ago
@felixfontein and @gotmax23
What about adding an input to set the Python version?
python-version:
required: true
type: choice
options:
- '3.11'
- '3.10'
default: '3.11'
Then we should be able to update the nox args with something like this:
nox-args: >-
-e
'pip-compile-${{ inputs.python-version || '3.11' }}(requirements)'
'pip-compile-${{ inputs.python-version || '3.11' }}(requirements-relaxed)'
I've thought about that; alternatively we could automatically figure out the right version from the branch. But I guess making the Python version configurable would be a first step, we can always improve it later on :)
I think we can actually fix the noxfile to not require specifying a Python version in the session name. I'll take a look (probably this weekend).
I think we can actually fix the noxfile to not require specifying a Python version in the session name.
diff --git a/noxfile.py b/noxfile.py
index 9b53bc1d65..7904ab49e8 100644
--- a/noxfile.py
+++ b/noxfile.py
@@ -155,7 +155,7 @@ requirements_files = list(
)
-@nox.session(name="pip-compile", python=["3.11"])
+@nox.session(name="pip-compile", python="3.11")
@nox.parametrize(["req"], requirements_files, requirements_files)
def pip_compile(session: nox.Session, req: str):
"""
and then
$ nox -l | grep pip-compile
- pip-compile(requirements-relaxed)
- pip-compile(requirements)
- pip-compile(pr_labeler)
- pip-compile(spelling)
- pip-compile(formatters)
- pip-compile(tag)
- pip-compile(static)
- pip-compile(typing)
as opposed to the previous
$ nox -l | grep pip-compile
- pip-compile-3.11(typing)
- pip-compile-3.11(pr_labeler)
- pip-compile-3.11(spelling)
- pip-compile-3.11(static)
- pip-compile-3.11(formatters)
- pip-compile-3.11(tag)
- pip-compile-3.11(requirements)
- pip-compile-3.11(requirements-relaxed)
from @felixfontein in https://github.com/ansible/ansible-documentation/pull/1920#issuecomment-2480693020
it's no longer possible to run the update dependency tasks for stable-2.17 and stable-2.16 in CI. On these two branches the workflows have been deleted, and if you try to run them from devel, it tries to run the update for Python 3.11, while both branches use other Python versions. This makes the workflow fail: