Skip to content

gh-109413: libregrtest: Add and improve type annotations #109405

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

Merged
merged 6 commits into from
Sep 14, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Sep 14, 2023

@vstinner, this is my attempt to create a PR with only "non-controversial" type hint changes, as you requested in #109382 (review). I'm not fully sure I understand exactly which changes you consider to be controversial, though, so apologies if there are still some changes here that you feel should be deferred to a future PR :-)

(For example: is the addition of a mypy config file in this PR okay? If not, I'm not sure how to test locally the changes I'm making here.)

This PR gets us down to 20 mypy errors if you cd into Lib/test and then run mypy --config-file libregrtest/mypy.ini.

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.

I am not sure that the config file without associate script is useful in the PR.

Here is a first review.

@AlexWaygood
Copy link
Member Author

AlexWaygood commented Sep 14, 2023

I am not sure that the config file without associate script is useful in the PR.

It can be used for local testing. You can cd into Lib/test, and then run mypy --config-file libregrtest/mypy.ini.

Without the config file, I don't know how to verify that the changes I'm making in this PR are correct. If I don't know whether the annotations I'm adding are correct or not, then I don't think there's much point in adding them.

@AlexWaygood
Copy link
Member Author

It can be used for local testing. You can cd into Lib/test, and then run mypy --config-file libregrtest/mypy.ini.

Without the config file, I don't know how to verify that the changes I'm making in this PR are correct. If I don't know whether the annotations I'm adding are correct or not, then I don't think there's much point in adding them.

Though I suppose I can keep the config around locally, but not commit it in this PR, if you prefer.

@AlexWaygood AlexWaygood marked this pull request as ready for review September 14, 2023 16:56
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, but please keep self.testsuite_xml: list[str] = [] bug on purpose for now. The code smells, maybe something is wrong here.

@AlexWaygood AlexWaygood changed the title libregrtest: Add and improve type annotations gh-109413: libregrtest: Add and improve type annotations Sep 14, 2023
@AlexWaygood AlexWaygood enabled auto-merge (squash) September 14, 2023 17:54
@AlexWaygood
Copy link
Member Author

Thanks for the review @vstinner!

@AlexWaygood AlexWaygood merged commit 3b9d10b into python:main Sep 14, 2023
@AlexWaygood AlexWaygood deleted the libregrtest-type-hints branch September 14, 2023 18:33
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.

2 participants