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 · 7 comments
Open

Add typing to more build tools #133403

sobolevn opened this issue May 4, 2025 · 7 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
…`mypy` (pythonGH-133404)

(cherry picked from commit 50b52cb)

Co-authored-by: sobolevn <mail@sobolevn.me>
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 <mail@sobolevn.me>
Co-authored-by: Zachary Ware <zach@python.org>
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 <mail@sobolevn.me>
sobolevn added a commit that referenced this issue May 8, 2025
sobolevn added a commit that referenced this issue May 8, 2025
…133453)

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 issue 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 issue 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>
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 <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 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 <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 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
…ypy (pythonGH-133735)

(cherry picked from commit cd2f234)

Co-authored-by: sobolevn <mail@sobolevn.me>
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 <mail@sobolevn.me>
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

2 participants