Skip to content

gh-133403: Type Tools/build/verify_ensurepip_wheels.py and check it with mypy - #133453

Merged
sobolevn merged 8 commits into
python:mainfrom
Flosckow:issue-133403
May 8, 2025
Merged

gh-133403: Type Tools/build/verify_ensurepip_wheels.py and check it with mypy#133453
sobolevn merged 8 commits into
python:mainfrom
Flosckow:issue-133403

Conversation

@Flosckow

@FlosckowFlosckow commented May 5, 2025

Copy link
Copy Markdown
Contributor

Add typing for verify_ensurepip_wheels and check it with mypy.
related to #133403 (comment)

@bedevere-app

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@sobolevnsobolevn 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! Several suggestions

Comment threadTools/build/verify_ensurepip_wheels.py
Comment threadTools/build/verify_ensurepip_wheels.py Outdated
Comment threadTools/build/verify_ensurepip_wheels.py Outdated
Comment threadTools/build/verify_ensurepip_wheels.py Outdated

@sobolevnsobolevn 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.

I can't merge your PR right now, because we are waiting for the first 3.14 beta release and the branch is locked. https://discuss.python.org/t/python-3-14-0-beta-1-is-near/90921

But, this looks good to me. Thanks a lot!
Congrats on your first CPython PR 🎉

@Flosckow

Copy link
Copy Markdown
ContributorAuthor

@sobolevn, thx for your review))

@sobolevnsobolevn 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.

I fixed the merge conflicts for you, but please, add new dependencies for mypy job here:

- "Tools/build/generate_sbom.py"

So, it would match definitions in our mypy.ini file.

@picnixzpicnixz changed the title pythongh-133403: Type Tools/build/verify_ensurepip_wheels.py and check it with mypygh-133403: Type Tools/build/verify_ensurepip_wheels.py and check it with mypyMay 8, 2025
@python-cla-bot

python-cla-botBot commented May 8, 2025

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@Flosckow

Copy link
Copy Markdown
ContributorAuthor

@sobolevn, thx, I have added the check to the workflow.

Comment thread.github/workflows/mypy.yml
Comment threadTools/build/mypy.ini

@sobolevnsobolevn 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.

Thank you!

Comment threadTools/build/mypy.ini Outdated
@sobolevnsobolevn added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 8, 2025
@sobolevn
sobolevn enabled auto-merge (squash) May 8, 2025 17:27
@sobolevn
sobolevn merged commit 5f3d3f2 into python:mainMay 8, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @Flosckow for the PR, and @sobolevn for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2025
…mypy (pythonGH-133453)
(cherry picked from commit 5f3d3f2)
Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2025
…mypy (pythonGH-133453)
(cherry picked from commit 5f3d3f2)
Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label May 8, 2025
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label May 8, 2025
sobolevn added a commit that referenced this pull request May 8, 2025
… mypy (GH-133453) (#133690)
gh-133403: Check `Tools/build/verify_ensurepip_wheels.py` with mypy (GH-133453)
(cherry picked from commit 5f3d3f2)
Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
sobolevn added a commit that referenced this pull request May 8, 2025
… mypy (GH-133453) (#133689)
gh-133403: Check `Tools/build/verify_ensurepip_wheels.py` with mypy (GH-133453)
(cherry picked from commit 5f3d3f2)
Co-authored-by: Flosckow <66554425+Flosckow@users.noreply.github.com>
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-bot

Copy link
Copy Markdown

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

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

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/1298) and take a look at the build logs.
  4. Check if the failure is related to this commit (c2cddb7) 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/1298

Failed tests:

  • test_socket

Failed subtests:

  • testSourceAddress - test.test_socket.NetworkConnectionAttributesTest.testSourceAddress
  • 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/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/threading.py", line 1041, in _bootstrap_innerself.run()
~~~~~~~~^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/threading.py", line 992, in runself._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 240, in serve_foreverself._handle_request_noblock()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 320, in _handle_request_noblockself.handle_error(request, client_address)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 318, in _handle_request_noblockself.process_request(request, client_address)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 349, in process_requestself.finish_request(request, client_address)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 362, in finish_requestself.RequestHandlerClass(request, client_address, self)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 768, in __init__self.finish()
~~~~~~~~~~~^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/socketserver.py", line 863, in finishself.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/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 222, in test_UnixDatagramServerself.run_server(socketserver.UnixDatagramServer,
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socketserver.DatagramRequestHandler,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^self.dgram_examine)
^^^^^^^^^^^^^^^^^^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/support/threading_helper.py", line 66, in decoratorreturn func(*args)
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/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/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/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/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/test_socketserver.py", line 43, in receiveraiseRuntimeError("timed out on %r"% (sock,))
RuntimeError: timed out on <socket.socket fd=23, family=1, type=2, proto=0, laddr=./test_python_rn15bc39.sock>
Traceback (most recent call last):
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/test_socket.py", line 417, in raise_queued_exceptionraiseself.queue.get()
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/test_socket.py", line 454, in clientRun
test_func()
~~~~~~~~~^^
File "/Users/buildbot/Library/Developer/XCTestDevices/9449EF01-B9BB-463B-BC72-6BBF98F28897/data/Containers/Bundle/Application/57FFADF3-7B3F-4171-9706-296D30AE6DB0/iOSTestbed.app/python/lib/python3.13/test/test_socket.py", line 5783, in _testSourceAddressself.assertEqual(self.cli.getsockname()[1], self.source_port)
~~~~~~~~~~~~~~~~~~~~^^OSError: [Errno 9] Bad file descriptor

Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…mypy (python#133453)
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…mypy (python#133453)
Co-authored-by: Daniil Dumchenko <dumchenko.de@sibvaleo.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Flosckow@bedevere-bot@sobolevn