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

enable strictness flags for mypy #5531

Merged
merged 7 commits into from
May 8, 2022

Conversation

dimbleby
Copy link
Contributor

@dimbleby dimbleby commented May 2, 2022

Enable strict mypy checking, and fix errors arising.

@dimbleby
Copy link
Contributor Author

dimbleby commented May 2, 2022

Hmm, I'd rebased this on master in the hope of making for easier review: but it looks as though it depends too much on others - in particular, #5485 and the addition of py.typed in poetry-core.

Let's get those merged and released first, please, then this will be ready to go...

@dimbleby
Copy link
Contributor Author

dimbleby commented May 3, 2022

closer now that #5485 is merged, I think we need

  • run mypy in proper environment #5279 so that the pipeline does its typechecking in the proper environment
  • poetry-core to be published with py.typed, so that we recognise types from that project

@dimbleby dimbleby force-pushed the strict-mypy branch 4 times, most recently from 97b130a to 3e0c2dc Compare May 7, 2022 14:41
@dimbleby
Copy link
Contributor Author

dimbleby commented May 7, 2022

this looks as though it has got worse ince #5279 was merged, but that's only because we now run mypy on all platforms. We're now just waiting on publishing a poetry-core that includes py.typed.

Maybe it's worthwhile updating this MR to treat poetry-core as untyped, and then reverse those changes when the next version of that project is published.

@dimbleby
Copy link
Contributor Author

dimbleby commented May 7, 2022

Maybe it's worthwhile updating this MR to treat poetry-core as untyped

I've done this, in the hope of getting the improved mypy settings merged sooner rather than later.

When the next poetry-core is published, we'll get a handful of warnings about unnecessary # ignore: type[...] markers, which can be resolved simply by removing them.

@dimbleby dimbleby force-pushed the strict-mypy branch 4 times, most recently from 1ec7f91 to 644f23d Compare May 7, 2022 15:47
neersighted
neersighted previously approved these changes May 7, 2022
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

This looks really good, and the un-cargo-culted mypy options are a breath of fresh air. I agree with the incremental approach -- better to get this work in and prevent the need to endlessly rebase than to wait for the perfect one-shot change.

@neersighted
Copy link
Member

@dimbleby Needs another rebase, sorry!

@dimbleby
Copy link
Contributor Author

dimbleby commented May 8, 2022

More conflicts, and also a new mistake to fix... any chance we can get this merged?

Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

Let's ship it :)

@neersighted
Copy link
Member

Oh bloody hell more conflicts... Sorry! It looks good to merge as soon as the next rebase is done.

@dimbleby
Copy link
Contributor Author

dimbleby commented May 8, 2022

@neersighted this is not currently conflicted, it should merge cleanly

@neersighted
Copy link
Member

Ah, looks like my local pull wasn't up to date. Here we go!

@neersighted neersighted merged commit 4817130 into python-poetry:master May 8, 2022
@dimbleby dimbleby deleted the strict-mypy branch May 8, 2022 21:11
@kasteph kasteph mentioned this pull request May 30, 2022
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants