Skip to content

Enable Mypy --strict internally #514

Closed

Description

@michaeloliverx

I think being compatible with mypy --strict benefits end users who are also using it, if #513 is merged then there isn't much work left to be compatible with strict mode.

See also #512

Activity

  1. michaeloliverx commented on Mar 30, 2022

    @michaeloliverx
    ContributorAuthor

    What do @encode/maintainers think of this?

  2. adriangb commented on Mar 30, 2022

    @adriangb

    Would we do it only for the codebase or also for tests? The benefit of doing it for tests is that you get to asses what the experience would be like for a user in strict mode.

  3. adriangb commented on Mar 30, 2022

    @adriangb

    I see you did both in your PR. I'm in favor of it 😁

  4. lovelydinosaur commented on Mar 30, 2022

    @lovelydinosaur
    Member

    Based on #524 I'd probably be somewhat against it - looks like extra noise & fluff from my perspective.

  5. michaeloliverx commented on Mar 30, 2022

    @michaeloliverx
    ContributorAuthor

    Would we do it only for the codebase or also for tests? The benefit of doing it for tests is that you get to asses what the experience would be like for a user in strict mode.

    +1 for tests

    I didn't type tests before I read this article https://sethmlarson.dev/blog/tests-arent-enough-case-study-after-adding-types-to-urllib3#type-your-tests which outlined the same benefit.

  6. michaeloliverx commented on Mar 30, 2022

    @michaeloliverx
    ContributorAuthor

    Based on #524 I'd probably be somewhat against it - looks like extra noise & fluff from my perspective.

    I agree its quite a bit of noise.. another option would be to do it incrementally as files are changed?

  7. RA80533 commented on Apr 24, 2022

    @RA80533

    Based on #524 I'd probably be somewhat against it - looks like extra noise & fluff from my perspective.

    Are there particular changes in the PR that you would rather see addressed separately, @tomchristie?

    1. Narrowing # type: ignore to a particular class of error
    2. Correcting incomplete dict and list types
    3. Using type aliases on values with domain significance (HeadersAsMapping versus dict)
    4. Casting types brought in from the h2 package

    2. is the most important for the purpose of the PR. Each correction means one less error showing up to the user in VS Code and the like.

  8. stale commented on May 31, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  9. graingert commented on Jun 19, 2022

    @graingert
    Contributor

    adding typing in anyio found a large number of type level bugs, I'm in favor of this change - so unmarking stale

  10. lovelydinosaur commented on Oct 7, 2022

    @lovelydinosaur
    Member

    I'm okay with us doing this, or at least with us moving towards it incrementally.
    @michaeloliverx's work on #524 showed that it's quite a big change footprint.
    I'd be happy to see PRs that either deal with changes on a one-module-at-a-time or one-kind-of-fix-at-a-time basis.

  11. adriangb commented on Oct 7, 2022

    @adriangb

    I think we probably want to turn on --strict one file at a time right?

  12. lovelydinosaur commented on Oct 7, 2022

    @lovelydinosaur
    Member

    Yeah that sort of thing.
    It'd probably be okay to make the fixes incrementally, without necessarily ratcheting them in using the CI.
    We could improve them bit by bit and only hard-enforce it once we get there.

  13. lovelydinosaur commented on Nov 17, 2022

    @lovelydinosaur
    Member

    See encode/httpx#2436 for how I think we should approach this.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions