Skip to content
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

gh-109413: Add more type hints to libregrtest #126352

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 3, 2024

While working on #126237 I've noticed that there are quite a lot of simple and uncontroversial type hints that I can add to libregrtest.

I also bumped mypy to the recent version (it is the same as 1.12, but faster).

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@sobolevn sobolevn merged commit bfc1d25 into python:main Nov 4, 2024
50 checks passed
@sobolevn
Copy link
Member Author

sobolevn commented Nov 4, 2024

Thank you! I think that we backport such changes (based on experience of #109413), so I will add labels!

@sobolevn sobolevn added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 4, 2024
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @sobolevn, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker bfc1d2504c183a9464e65c290e48516d176ea41f 3.12

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 4, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 4, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 4, 2024
@sobolevn
Copy link
Member Author

sobolevn commented Nov 4, 2024

I will try to create a manual backport to 3.12, but it is not easy: #125597

@AlexWaygood
Copy link
Member

Thanks! If you're interested in working in more improvements here, the mypy config we use for libregrtest is extremely lenient at the moment; ideally we'd make it stricter. In particular, we still have strict_optional = false for several submodules of libregrtest 😱 https://github.com/python/cpython/blob/main/Lib/test/libregrtest/mypy.ini

I will try to create a manual backport to 3.12, but it is not easy: #125597

I wouldn't worry about it too much if it's hard. I wouldn't say that these changes are important to backport in and of themselves. The main reason to backport them is to reduce the risk of merge conflicts when backporting future bugfixes (which are important to backport) to libregrtest. If we run into such merge conflicts in the future, I think it shouldn't be too hard to just remove the type hints from certain functions in order to solve the conflicts with the 3.12 branch.

sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 4, 2024
sobolevn added a commit to sobolevn/cpython that referenced this pull request Nov 4, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 4, 2024

GH-126389 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 4, 2024
@sobolevn
Copy link
Member Author

sobolevn commented Nov 4, 2024

Yes, I am working on some further fixes :)
But before I fix fixes here, I have to fix fixes in mypy first 😆
python/mypy#18103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants