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

add(mypy): type stubs for some ignored libraries #559

Merged
merged 1 commit into from
Nov 13, 2020

Conversation

sbdchd
Copy link
Collaborator

@sbdchd sbdchd commented Nov 12, 2020

Added basic type stubs for some of the smaller libraries the bot and
web_api use.

We put the types in the typings folder which we configure in the Mypy,
but is also the default path that pyright looks at
so pylance should just work.

Libraries with missing types that remain:

  • structlog, waiting on the release of its typed api
  • requests_async, need to convert to httpx which has types
  • asyncio_redis, maybe write stubs, or use a different client
  • django, stubs exist, last time we tried it, there were a number of
    false positives
  • stripe, no types currently, could probably write some minimal stubs
    rel: Feature Request: type annotations stripe/stripe-python#650

rel: indygreg/python-zstandard#120
rel: davidblewett/rure-python#23
rel: jazzband/dj-database-url#135

Added basic type stubs for some of the smaller libraries the bot and
web_api use.

Libraries with missing types that remain:
- structlog, waiting on the release of its typed api
- requests_async, need to convert to httpx which has types
- asyncio_redis, maybe write stubs, or use a different client
- django, stubs exist, last time we tried it, there were a number of
  false positives
- stripe, no types currently, could probably write some minimal stubs
  rel: stripe/stripe-python#650
@sbdchd sbdchd requested a review from chdsbd November 12, 2020 23:45
@sbdchd sbdchd added the automerge Mark PR for auto merge by Kodiak label Nov 12, 2020
@sbdchd sbdchd changed the title add(bot,web_api): setup types stubs for some ignored libraries add(mypy): type stubs for some ignored libraries Nov 12, 2020
from re import Match, RegexFlag
from typing import AnyStr, Optional, Pattern, overload

_FlagsType = RegexFlag
Copy link
Owner

Choose a reason for hiding this comment

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

why do you assign here instead of using RegexFlag directly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk, I just styled this after type shed

@kodiakhq kodiakhq bot merged commit da1e1bf into master Nov 13, 2020
@kodiakhq kodiakhq bot deleted the steve/add-more-stubs branch November 13, 2020 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Mark PR for auto merge by Kodiak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants