Skip to content

Improve daemon docs; add docs for dmypy suggest #8032

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 3 commits into from
Nov 29, 2019

Conversation

ilevkivskyi
Copy link
Member

No description provided.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

It's good idea to document these features so that others can write additional integrations. Left various minor comments; I have some other even smaller edits that I may do after this has been merged.


.. option:: --status-file FILE

Status file to retrieve daemon details. This is normally a JSON file
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested edit: "Use FILE as the status file for storing daemon runtime state. ..."


.. option:: --timeout TIMEOUT

Server shutdown timeout (in seconds). Only available for ``start``,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested edit: Automatically shut down server after TIMEOUT seconds of inactivity.

.. option:: --fswatcher-dump-file FILE

Collect information about the current file state. Only available for
``status`` command.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that this description is not detailed enough to be useful. I think that it's fine to leave this undocumented for now. Altarnatively, at least the purpose of this information and the structure/contents of it should probably be documented.


.. option:: --perf-stats-file FILE

Write performance telemetry information to the given file. Only available
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: Tthis is not telemetry, since it's only written to a local file.

Suggested edit: "Write performance profiling information to FILE.

.. option:: --update FILE

Files in the run to add or check again, may be repeated. Default: all
files from the previous run. Only available for ``recheck`` command.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Give some motivation for why somebody might want to use this option. Something about speeding up runs if there are thousands of files, and maybe suggest using file events to find the modified files.

Maybe also mention that this option is never required and is only available for speeding things up.

Files to remove from the run, may be repeated. Only available for
``recheck`` command.

Static inference of annotations
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe move this to a separate rst file, since this is quite distinct from other features provided by dmypy, and mostly relevant for users that are going to write integrations (since the low-level UX is kind of hard to use).

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we can keep it in the same file for now. It is anyway at the very end and it is probably OK to attract some attention to it.

Also I can't find a good name for a section that would look good in table of contents with the daemon. I think we can move it to a separate file when we will add dmypy reveal, then it will look more natural.


Running this command will produce a suggested signature in the format
``(param_type_1, param_type_2, ...) -> ret_type``. This may be used by IDEs
or similar tools to propose to user and/or insert the annotation into file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I mentioned earlier, this information is key and should probably be presented earlier.

Maybe discuss what happens to arguments with default values, *args and **kwargs.


.. option:: --json

Use JSON format to output the signature, so that `PyAnnotate`_ can use it
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested edit: "Output the signature as JSON, so that ..."

Maybe also give an example of the JSON?

.. option:: --use-fixme NAME

A dummy name to use instead of plain ``Any`` for types that cannot
be inferred.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add some motivation for this feature.


root = format_id(0)

Mypy can infer that ``format_id()`` takes an ``int`` and returns a ``str``.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe explain the algorithm in little detail, such as mentioning that mypy looks at call sites and the function definition to infer types.

@ilevkivskyi ilevkivskyi merged commit b7465de into python:master Nov 29, 2019
@ilevkivskyi ilevkivskyi deleted the update-daemon-docs branch November 29, 2019 14:31
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy