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

Provide an "API" for invoking the daemon #5972

Merged
merged 2 commits into from
Nov 29, 2018
Merged

Provide an "API" for invoking the daemon #5972

merged 2 commits into from
Nov 29, 2018

Conversation

msullivan
Copy link
Collaborator

Like the existing "api" for invoking mypy, it is just a thin wrapper
around calling the main function.

Like the existing "api" for invoking mypy, it is just a thin wrapper
around calling the main function.
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM, just one suggestion.


def run_dmypy(args: List[str]) -> Tuple[str, str, int]:
from mypy.dmypy import main
return _run(lambda: main(args))
Copy link
Member

Choose a reason for hiding this comment

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

IIUC this doesn't support incremental flushing of errors (maybe we will do this at some point), but it is the same for normal runs, so probably OK. Maybe add a comment about this.

# We do this explicitly to avoid exceptions percolating up
# through mypy.api invocations
traceback.print_exc()
sys.exit(2)
Copy link
Member

Choose a reason for hiding this comment

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

I like this choice, I think there are still some situations where 1 can be returned on a traceback in the server, but I will fix those separately later.

@msullivan msullivan merged commit abd319a into master Nov 29, 2018
@msullivan msullivan deleted the dmypy-api branch November 29, 2018 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants