FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update pre-commit hooks by mhsmith · Pull Request #137591 · python/cpython · GitHub

Repository navigation

Update pre-commit hooks - #137591

Merged
AA-Turner merged 4 commits into
python:mainfrom
mhsmith:zizmor-1.11.0
Aug 10, 2025
Merged

AA-Turner merged 4 commits into
python:mainfrom
mhsmith:zizmor-1.11.0

Conversation

mhsmith commented Aug 9, 2025

Copy link
Copy Markdown
Member

Split from #137186. That PR no longer needs the zizmor update, but since I've worked out exactly how to do it, we might as well merge it anyway.

StanFromIreland added OS-android infra CI, GitHub Actions, buildbots, Dependabot, etc. and removed OS-android labels Aug 9, 2025

hugovk commented Aug 10, 2025

Copy link
Copy Markdown
Member

Let's update the other .pre-commit-config.yaml hooks as well by running pre-commit autoupdate --jobs 0.

We're on Ruff v0.11.8.

Ruff 0.12.* gives out a lot of syntax errors, for example: "invalid-syntax: Cannot use type alias statement on Python 3.10 (syntax was added in Python 3.12)"

If you like we can leave those for another time and just bump to to the latest 0.11: v0.11.13.

mhsmith changed the title Update to zizmor version 1.11.0 Update pre-commit hooks Aug 10, 2025

mhsmith commented Aug 10, 2025

Copy link
Copy Markdown
Member Author

Ruff 0.12.* gives out a lot of syntax errors, for example: "invalid-syntax: Cannot use type alias statement on Python 3.10 (syntax was added in Python 3.12)"

I fixed this by specifying the target Python version.

Comment thread .pre-commit-config.yaml Outdated
- id: ruff
name: Run Ruff (lint) on Lib/test/
args: [--exit-non-zero-on-fix]
args: [--exit-non-zero-on-fix, --target-version=py313]

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I guess a low version was initially chosen to make backports easier?

Anyway, let's move the config to a .ruff.toml file so it also applies if running Ruff directly.

Suggested change
args: [--exit-non-zero-on-fix, --target-version=py313]
args: [--exit-non-zero-on-fix]

We have a top-level that defines target-version = "py310".

Let's override that in Lib/test/.ruff.toml, either:

  • target-version = "py313" like in Doc/.ruff.toml
  • [per-file-target-version] like in Tools/build/.ruff.toml (might be too files many to be worth it)

And we can also remove the t-string files from extend-exclude and put those under [per-file-target-version] for py314.

(Could do the same for test_grammar.py but it has some F811 errors that would need deciding about.)

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done.

mhsmith requested a review from AlexWaygood as a code owner August 10, 2025 15:49

hugovk 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you!

AA-Turner 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We can be a little more conservative here:

Comment thread Lib/test/.ruff.toml Outdated
Comment thread Lib/test/.ruff.toml

bedevere-app Bot commented Aug 10, 2025

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

mhsmith commented Aug 10, 2025

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again.

bedevere-app Bot commented Aug 10, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@AA-Turner, @hugovk: please review the changes made to this pull request.

bedevere-app Bot requested review from AA-Turner and hugovk August 10, 2025 22:12

AA-Turner 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Cheers

AA-Turner enabled auto-merge (squash) August 10, 2025 22:15
AA-Turner merged commit b36d23f into python:main Aug 10, 2025

Copy link
Copy Markdown

Thanks @mhsmith for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 10, 2025
(cherry picked from commit b36d23f)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

Copy link
Copy Markdown

Sorry, @mhsmith and @AA-Turner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker b36d23f58e8ab85b8576ab59c2ce72572c2cb12a 3.13

bedevere-app Bot commented Aug 10, 2025

Copy link
Copy Markdown

GH-137621 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 10, 2025
hugovk pushed a commit that referenced this pull request Aug 11, 2025
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
webknjaz pushed a commit to webknjaz/cpython that referenced this pull request Aug 11, 2025
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit b36d23f)

bedevere-app Bot commented Aug 11, 2025

Copy link
Copy Markdown

GH-137641 is a backport of this pull request to the 3.14 branch.

mhsmith removed the needs backport to 3.13 only security fixes label Aug 11, 2025

bedevere-app Bot commented Aug 11, 2025

Copy link
Copy Markdown

GH-137641 is a backport of this pull request to the 3.13 branch.

webknjaz pushed a commit to webknjaz/cpython that referenced this pull request Aug 11, 2025
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit b36d23f)
encukou pushed a commit that referenced this pull request Aug 12, 2025
(cherry picked from commit b36d23f)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.13 (tier-3) has failed when building commit 5d64571.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1386/builds/1530) and take a look at the build logs.
  4. Check if the failure is related to this commit (5d64571) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1386/builds/1530

Failed tests:

  • test_socketserver

Failed subtests:

  • test_UnixDatagramServer - test.test_socketserver.SocketServerTest.test_UnixDatagramServer

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/threading.py", line 1043, in _bootstrap_inner
    self.run()
    ~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/threading.py", line 994, in run
    self._target(*self._args, **self._kwargs)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 240, in serve_forever
    self._handle_request_noblock()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 320, in _handle_request_noblock
    self.handle_error(request, client_address)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 318, in _handle_request_noblock
    self.process_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 349, in process_request
    self.finish_request(request, client_address)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 768, in __init__
    self.finish()
    ~~~~~~~~~~~^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 863, in finish
    self.socket.sendto(self.wfile.getvalue(), self.client_address)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [Errno 54] Connection reset by peer
ERROR


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 222, in test_UnixDatagramServer
    self.run_server(socketserver.UnixDatagramServer,
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    socketserver.DatagramRequestHandler,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    self.dgram_examine)
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/support/threading_helper.py", line 66, in decorator
    return func(*args)
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 133, in run_server
    testfunc(svrcls.address_family, addr)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 160, in dgram_examine
    buf = data = receive(s, 100)
                 ~~~~~~~^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 43, in receive
    raise RuntimeError("timed out on %r" % (sock,))
RuntimeError: timed out on <socket.socket fd=31, family=1, type=2, proto=0, laddr=./test_python_pmk5csn_.sock>


Traceback (most recent call last):
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 222, in test_UnixDatagramServer
    self.run_server(socketserver.UnixDatagramServer,
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    socketserver.DatagramRequestHandler,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    self.dgram_examine)
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/support/threading_helper.py", line 66, in decorator
    return func(*args)
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 133, in run_server
    testfunc(svrcls.address_family, addr)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 160, in dgram_examine
    buf = data = receive(s, 100)
                 ~~~~~~~^^^^^^^^
  File "/Users/buildbot/Library/Developer/XCTestDevices/BC99FB54-7DA1-44B4-AE19-F8178A18EC35/data/Containers/Bundle/Application/E558837D-1277-4A40-A506-9968B4BB6A8B/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 43, in receive
    raise RuntimeError("timed out on %r" % (sock,))
RuntimeError: timed out on <socket.socket fd=31, family=1, type=2, proto=0, laddr=./test_python_16zmlugj.sock>

hugovk commented Aug 12, 2025

Copy link
Copy Markdown
Member

ConnectionResetError: [Errno 54] Connection reset by peer, unrelated.

Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra CI, GitHub Actions, buildbots, Dependabot, etc. skip issue skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL