[thought] `python-version` input -> hook
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
调研方向
Start with .readthedocs.yaml and the workflow's existing post-src-checkout, Set up pip cache, and actions/setup-python steps. Trace the proposed interactions among python-version, matrices, custom sources such as deadsnakes or uv, and a possible prepare-python-interpreter hook; done means the behavior and required-input contract are agreed.
由索引模型根据 Issue 内容生成。
描述
Sometimes, the Python version cannot be known before starting the job by passing the input easily. One such case is trying to have a single source of truth for building the docs in RTD and GHA.
In many project, the RTD config gluing things together looks as follows:
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
---
version: 2
build:
os: ubuntu-24.04
tools:
python: >- # has to be parsed as a YAML string
3.11
commands:
- >-
PYTHONWARNINGS=error
python3 -Im venv "${READTHEDOCS_VIRTUALENV_PATH}"
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
pip install tox
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
tox -e build-docs --notest -vvvvv
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
tox -e build-docs --skip-pkg-install -q
--
"${READTHEDOCS_OUTPUT}"/html -b dirhtml
...
build.tools.python can only be hardcoded and not sourced from elsewhere so that has to become our source of truth.
And I'd like to feed that version into GHA and possibly into other places. But passing it through the python-version input would mean needing another job to parse this config and possibly separate the reusable workflow out so it would all integrate in an ugly way.
I was initially thinking that it may be a good idea to have a special value like python-version: skip, or python-version: external, or python-version: hook that would mean skipping the actions/setup-python invocation. I thought, that maybe the callers could then use the post-src-checkout hook to do this Python setup and version sourcing.
As I'm writing this, I think that this probably deserves its own hook, perhaps, — prepare-python-interpreter. I'd probably have it between post-src-checkout and Set up pip cache, and move actions/setup-python there too (right after the hook?).
Though, it'd be a good idea to figure out how these are supposed to interact w/ each other. Maybe, instead of having a special sentinel value, we could have the hook output the version and if it does (it could have env-dependent skips internally and only set up the version dynamically for the docs build), we'd skip actions/setup-python. Would we need to make the input non-required, then? What about the matrices w/ custom Python sources like deadsnakes or uv? How would they interact?
- 主要语言
- 没有语言数据
- 星标
- 6
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tox-dev/workflow 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 12/100
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
-
enhancement help wanted question
难度 4/5 3-5 天 新手友好度 25/100
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
bug customer-reported
难度 2/5 1-3 小时 新手友好度 82/100
MagnaCapax/PMSS#1011 ·
维护者通常 5 天内回复
-
[CI] Core CI doesn't run for changes to amoro-format-lance (and amoro-web)可能已有人在做 @MarkAlex1234 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 2 天内回复
-
area/infra theme/ci-dx
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
tech debt
难度 2/5 1-3 小时 新手友好度 74/100
TAMULib/fw-registry#543 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
code-yeongyu/senpi#2782 · 1 条评论 ·
维护者通常 1 天内回复