Skip to content

Add typing to more build tools #133403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sobolevn opened this issue May 4, 2025 · 9 comments
Open

Add typing to more build tools #133403

sobolevn opened this issue May 4, 2025 · 9 comments
Assignees
Labels
infra CI, GitHub Actions, buildbots, Dependabot, etc. type-feature A feature request or enhancement

Comments

@sobolevn
Copy link
Member

sobolevn commented May 4, 2025

@sobolevn sobolevn added infra CI, GitHub Actions, buildbots, Dependabot, etc. type-feature A feature request or enhancement labels May 4, 2025
@sobolevn sobolevn self-assigned this May 4, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 4, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 4, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 4, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 4, 2025
@sobolevn
Copy link
Member Author

sobolevn commented May 4, 2025

Tools/build/verify_ensurepip_wheels.py also has annotations, but it is not checked. Will add in a separate PR, since it requires a bit of modification:

Tools/build/verify_ensurepip_wheels.py:41: error: Argument 1 to "print_error" has
incompatible type "Path"; expected "str"  [arg-type]
                    print_error(p, f"Found more than one wheel for package {package_n...
                                ^
Tools/build/verify_ensurepip_wheels.py:56: error: Argument 1 to "print_error" has
incompatible type "Path"; expected "str"  [arg-type]
                package_path,
                ^~~~~~~~~~~~
Tools/build/verify_ensurepip_wheels.py:66: error: Argument 1 to "print_error" has
incompatible type "Path"; expected "str"  [arg-type]
            print_error(package_path, f"Could not fetch JSON metadata for {package_na...
                        ^~~~~~~~~~~~
Tools/build/verify_ensurepip_wheels.py:76: error: Argument 1 to "print_error" has
incompatible type "Path"; expected "str"  [arg-type]
            print_error(package_path, f"No digest for {package_name} found from PyPI....
                        ^~~~~~~~~~~~
Tools/build/verify_ensurepip_wheels.py:82: error: Name "expected_digest" may be undefined 
[possibly-undefined]
        print(f"Expected digest: {expected_digest}")
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tools/build/verify_ensurepip_wheels.py:87: error: Argument 1 to "print_error" has
incompatible type "Path"; expected "str"  [arg-type]
                package_path, f"Failed to verify the checksum of the {package_name} w...
                ^~~~~~~~~~~~
Tools/build/verify_ensurepip_wheels.py:92: error: Argument 1 to "print_notice" has
incompatible type "Path"; expected "str"  [arg-type]
            package_path,
            ^~~~~~~~~~~~
Found 7 errors in 1 file (checked 4 source files)
                                          

@sobolevn
Copy link
Member Author

sobolevn commented May 4, 2025

We should also merge #133405 before any other PR.

@Flosckow
Copy link
Contributor

Flosckow commented May 5, 2025

Can I work on it?

@sobolevn
Copy link
Member Author

sobolevn commented May 5, 2025

@Flosckow sure, you can help with #133403 (comment) I haven't started yet :)

Thank you!

@Flosckow
Copy link
Contributor

Flosckow commented May 5, 2025

@Flosckowконечно, вы можете помочь с #133403 (комментарий) Я еще не начал :)

Спасибо!

Yes, I'll try to do this, the only thing I might be a little slow is this is my first pr in cpython.

@sobolevn
Copy link
Member Author

sobolevn commented May 5, 2025

No worries, I can surely help with any questions you might have. Feel free to ask them :)

@Flosckow
Copy link
Contributor

Flosckow commented May 5, 2025

@sobolevn, can you check it? #133453

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 7, 2025
sobolevn added a commit that referenced this issue May 8, 2025
… `mypy` (GH-133404) (#133603)

gh-133403: Type `Tools/build/update_file.py` and check it with `mypy` (GH-133404)
(cherry picked from commit 50b52cb)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Zachary Ware <[email protected]>
sobolevn added a commit to sobolevn/cpython that referenced this issue May 8, 2025
…t with `mypy` (pythonGH-133404)

(cherry picked from commit 50b52cb)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue May 8, 2025
sobolevn added a commit that referenced this issue May 8, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 8, 2025
…mypy (pythonGH-133453)

(cherry picked from commit 5f3d3f2)

Co-authored-by: Flosckow <[email protected]>
Co-authored-by: Daniil Dumchenko <[email protected]>
Co-authored-by: sobolevn <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 8, 2025
…mypy (pythonGH-133453)

(cherry picked from commit 5f3d3f2)

Co-authored-by: Flosckow <[email protected]>
Co-authored-by: Daniil Dumchenko <[email protected]>
Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue 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 <[email protected]>
Co-authored-by: Daniil Dumchenko <[email protected]>
Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue 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 <[email protected]>
Co-authored-by: Daniil Dumchenko <[email protected]>
Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit to sobolevn/cpython that referenced this issue May 9, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 9, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 9, 2025
sobolevn added a commit that referenced this issue May 9, 2025
…mypy (GH-133735) (#133764)

gh-133403: Check `Tools/build/generate-build-details.py` with mypy (GH-133735)
(cherry picked from commit cd2f234)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit to sobolevn/cpython that referenced this issue May 10, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 15, 2025
sobolevn added a commit to sobolevn/cpython that referenced this issue May 15, 2025
sobolevn added a commit that referenced this issue May 15, 2025
) (#134038)

gh-133403: Check `Tools/build/deepfreeze.py` with mypy (GH-133802)
(cherry picked from commit 7eaa097)

Co-authored-by: sobolevn <[email protected]>
sobolevn added a commit that referenced this issue May 15, 2025
@chrisgramberg678
Copy link

Hello from PyCon US sprints 👋
I see that there are a few other files that could use some mypy fixes and I'd like to help out! I think I will just go one file at a time if that's alright? If so, I think I will just go alphabetically and try Tools/build/check_extension_modules.py to start.

@sobolevn
Copy link
Member Author

@chrisgramberg678 thank you! feel free to ping me on PRs :)

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. type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants