Skip to content

tidy: Update Python version requirements to 3.11 - #160896

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
marcoieni:tidy-python-3.11
Aug 14, 2026
Merged

tidy: Update Python version requirements to 3.11#160896
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
marcoieni:tidy-python-3.11

Conversation

@marcoieni

@marcoieni marcoieni commented Aug 11, 2026

Copy link
Copy Markdown
Member

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.

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 11, 2026
@@ -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

@marcoieni marcoieni Aug 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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
  '

View changes since the review

Comment thread src/tools/tidy/src/extra_checks/mod.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 11, 2026
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.

@marcoieni marcoieni Aug 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I couldn't update to ubuntu 24 because python2.7 is not available there from apt.

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed in #t-infra/bootstrap > Do we need to support Python 2?, we should just kick out the Python 2.7 package.

@marcoieni
marcoieni marked this pull request as ready for review August 11, 2026 08:38
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

tidy extra checks were modified.

cc @lolbinarycat

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 11, 2026
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. One non-blocking thought, r=me with or without.

View changes since this review

Comment thread src/ci/docker/host-x86_64/tidy/Dockerfile Outdated
Comment thread src/tools/tidy/src/extra_checks/mod.rs
@jieyouxu

Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

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.

Comment on lines -36 to -38
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

@marcoieni marcoieni Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AI found out that reuse is not used in tidy. It is only used in pr-check-1:

reuse --include-submodules lint && \

View changes since the review

# 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

@marcoieni marcoieni Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

View changes since the review

# 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"

@marcoieni marcoieni Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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?

View changes since the review

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That should be fine, we usually have problems with py versions too old

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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 \

@marcoieni marcoieni Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

On Ubuntu 24.04, python3 only suggests python3-venv, so we need to install it.

Venv is used by tidy you can see:

fn create_venv_at_path(path: &Path) -> Result<(), Error> {

View changes since the review

@marcoieni
marcoieni marked this pull request as draft August 13, 2026 11:10
@marcoieni
marcoieni marked this pull request as ready for review August 13, 2026 11:40
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 13, 2026
@marcoieni
marcoieni requested a review from jieyouxu August 13, 2026 11:40

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 948b5ab has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 13, 2026
…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.
rust-bors Bot pushed a commit that referenced this pull request Aug 13, 2026
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)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 13, 2026
…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.
rust-bors Bot pushed a commit that referenced this pull request Aug 13, 2026
…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)
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
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")
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
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")
@rust-bors
rust-bors Bot merged commit e1ce7da into rust-lang:main Aug 14, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 14, 2026
rust-timer added a commit that referenced this pull request Aug 14, 2026
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.
rust-bors Bot pushed a commit that referenced this pull request Aug 14, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants