tidy: Update Python version requirements to 3.11 - #160896
Conversation
| @@ -1,5 +1,5 @@ | |||
| # | |||
| # This file is autogenerated by pip-compile with Python 3.10 | |||
| # This file is autogenerated by pip-compile with Python 3.11 | |||
There was a problem hiding this comment.
To update this file I ran:
docker run --rm \
-v "$PWD":/workspace \
-w /workspace \
python:3.11-slim \
bash -c '
python -m pip install --no-cache-dir \
pip-tools==7.5.3 \
&&
pip-compile --generate-hashes --strip-extras \
src/tools/tidy/config/requirements.in
'
This comment has been minimized.
This comment has been minimized.
3194a6b to
dfe7f30
Compare
This comment has been minimized.
This comment has been minimized.
dfe7f30 to
dee0f81
Compare
| FROM ghcr.io/rust-lang/ubuntu:22.04 | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| # Install python3.11 because python3 in ubuntu22 resolves to python3.10, which is EOL in October 2026. |
There was a problem hiding this comment.
I couldn't update to ubuntu 24 because python2.7 is not available there from apt.
There was a problem hiding this comment.
As discussed in #t-infra/bootstrap > Do we need to support Python 2?, we should just kick out the Python 2.7 package.
|
|
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@rustbot author |
dee0f81 to
92a94d6
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| COPY host-x86_64/pr-check-1/reuse-requirements.txt /tmp/ | ||
| RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \ | ||
| && pip3 install virtualenv |
There was a problem hiding this comment.
AI found out that reuse is not used in tidy. It is only used in pr-check-1:
| # We use the ghcr base image because ghcr doesn't have a rate limit | ||
| # and the tidy job doesn't cache docker images in CI. | ||
| FROM ghcr.io/rust-lang/ubuntu:22.04 | ||
| FROM ubuntu:26.04 |
There was a problem hiding this comment.
There shouldn't be issues with the Docker rate limits in GitHub Actions because GitHub Actions have their own mirror of Docker images as far as I know.
ghcr is only handy when running github actions in other runner providers, like aws.
| # NOTE: intentionally uses python2 for x.py so we can test it still works. | ||
| # validate-toolstate only runs in our CI, so it's ok for it to only support python3. | ||
| ENV SCRIPT="python2.7 ../x.py test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck" | ||
| ENV SCRIPT="python3 ../x.py test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck" |
There was a problem hiding this comment.
python3 in ubuntu 26 resolves to python 3.14.4. I hope it's fine.
Should we run with the minimum version we declare (python 3.11) instead?
There was a problem hiding this comment.
That should be fine, we usually have problems with py versions too old
There was a problem hiding this comment.
I switched to ubuntu 24 where the default python is 3.12 so that at least it's a bit older than 3.14
| python3 \ | ||
| python3-pip \ | ||
| python3-pkg-resources \ | ||
| python3-venv \ |
There was a problem hiding this comment.
On Ubuntu 24.04, python3 only suggests python3-venv, so we need to install it.
Venv is used by tidy you can see:
rust/src/tools/tidy/src/extra_checks/mod.rs
Line 563 in 1e5ee35
92a94d6 to
948b5ab
Compare
…ouxu tidy: Update Python version requirements to 3.11 Similar to rust-lang#160429 I'm updating to 3.11 as requested in rust-lang#160429 (comment) because 3.10 is EOL in 2 months. ## AI disclosure gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile). I think my use of LLMs in this case can be categorized under [`“Trivial” code`](https://forge.rust-lang.org/policies/llm-usage.html#-allowed-with-caveats), so I guess it's fine.
Rollup of 14 pull requests Successful merges: - #158918 (x86_64-win: Enable f128 on LLVM 23+) - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs) - #160440 (Couple of misc improvements to the unwind infrastructure) - #160441 (PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian) - #160896 (tidy: Update Python version requirements to 3.11) - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows) - #161040 (Optimize CStr backing slice bounds checks) - #158885 (Add `core::num::Complex`) - #160928 (check `mut`-restriction when tuple constructor is used as a value) - #161002 (disallow `#[cold]` on `extern "custom"` functions) - #161016 (Fix invalid suggestion from try unlabled block) - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`) - #161044 (rustc-dev-guide subtree update) - #161046 (Enable unrolling feature of bors)
…ouxu tidy: Update Python version requirements to 3.11 Similar to rust-lang#160429 I'm updating to 3.11 as requested in rust-lang#160429 (comment) because 3.10 is EOL in 2 months. ## AI disclosure gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile). I think my use of LLMs in this case can be categorized under [`“Trivial” code`](https://forge.rust-lang.org/policies/llm-usage.html#-allowed-with-caveats), so I guess it's fine.
…uwer Rollup of 17 pull requests Successful merges: - #161045 (stdarch subtree update) - #157428 (allocator: refactor for stabilisation) - #158918 (x86_64-win: Enable f128 on LLVM 23+) - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs) - #160440 (Couple of misc improvements to the unwind infrastructure) - #160441 (PowerPC inline ASM: Fix scalar floats being in the wrong vector lane on little endian) - #160896 (tidy: Update Python version requirements to 3.11) - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows) - #161040 (Optimize CStr backing slice bounds checks) - #160928 (check `mut`-restriction when tuple constructor is used as a value) - #160969 (give layout errors from `size_of_val` and `align_of_val` a span) - #161002 (disallow `#[cold]` on `extern "custom"` functions) - #161016 (Fix invalid suggestion from try unlabled block) - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`) - #161044 (rustc-dev-guide subtree update) - #161046 (Enable unrolling feature of bors) - #161054 (rustdoc: Fix link title attribute value when field of enum variants)
Rollup of 23 pull requests Successful merges: - #157428 (allocator: refactor for stabilisation) - #158918 (x86_64-win: Enable f128 on LLVM 23+) - #160077 (Don't compute FnAbi for LLVM intrinsics) - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs) - #160440 (Couple of misc improvements to the unwind infrastructure) - #160896 (tidy: Update Python version requirements to 3.11) - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows) - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args) - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`) - #161037 (std: don't clean up the main thread's altstack) - #161040 (Optimize CStr backing slice bounds checks) - #161065 (core: Fix a typo in funnel shift documentation) - #158885 (Add `core::num::Complex`) - #160928 (check `mut`-restriction when tuple constructor is used as a value) - #160969 (give layout errors from `size_of_val` and `align_of_val` a span) - #161002 (disallow `#[cold]` on `extern "custom"` functions) - #161016 (Fix invalid suggestion from try unlabled block) - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`) - #161044 (rustc-dev-guide subtree update) - #161046 (Enable unrolling feature of bors) - #161054 (rustdoc: Fix link title attribute value when field of enum variants) - #161055 (`offload!` function-like macro) - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
Rollup of 23 pull requests Successful merges: - #157428 (allocator: refactor for stabilisation) - #158918 (x86_64-win: Enable f128 on LLVM 23+) - #160077 (Don't compute FnAbi for LLVM intrinsics) - #160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs) - #160440 (Couple of misc improvements to the unwind infrastructure) - #160896 (tidy: Update Python version requirements to 3.11) - #160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows) - #160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args) - #161036 (Use `with_types_for_suggestion!` in `write_struct_like()`) - #161037 (std: don't clean up the main thread's altstack) - #161040 (Optimize CStr backing slice bounds checks) - #161065 (core: Fix a typo in funnel shift documentation) - #158885 (Add `core::num::Complex`) - #160928 (check `mut`-restriction when tuple constructor is used as a value) - #160969 (give layout errors from `size_of_val` and `align_of_val` a span) - #161002 (disallow `#[cold]` on `extern "custom"` functions) - #161016 (Fix invalid suggestion from try unlabled block) - #161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`) - #161044 (rustc-dev-guide subtree update) - #161046 (Enable unrolling feature of bors) - #161054 (rustdoc: Fix link title attribute value when field of enum variants) - #161055 (`offload!` function-like macro) - #161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
Rollup merge of #160896 - marcoieni:tidy-python-3.11, r=jieyouxu tidy: Update Python version requirements to 3.11 Similar to #160429 I'm updating to 3.11 as requested in #160429 (comment) because 3.10 is EOL in 2 months. ## AI disclosure gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile). I think my use of LLMs in this case can be categorized under [`“Trivial” code`](https://forge.rust-lang.org/policies/llm-usage.html#-allowed-with-caveats), so I guess it's fine.
Rollup merge of #160896 - marcoieni:tidy-python-3.11, r=jieyouxu tidy: Update Python version requirements to 3.11 Similar to #160429 I'm updating to 3.11 as requested in #160429 (comment) because 3.10 is EOL in 2 months. ## AI disclosure gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile). I think my use of LLMs in this case can be categorized under [`“Trivial” code`](https://forge.rust-lang.org/policies/llm-usage.html#-allowed-with-caveats), so I guess it's fine.
View all comments
Similar to #160429
I'm updating to 3.11 as requested in #160429 (comment) because 3.10 is EOL in 2 months.
AI disclosure
gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile).
I think my use of LLMs in this case can be categorized under
“Trivial” code, so I guess it's fine.