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

The execution results of dmypy are not as expected #17797

Open
WutingjiaX opened this issue Sep 20, 2024 · 0 comments
Open

The execution results of dmypy are not as expected #17797

WutingjiaX opened this issue Sep 20, 2024 · 0 comments
Labels
bug mypy got something wrong

Comments

@WutingjiaX
Copy link

Operation steps

  1. I start a daemon server
    command = [
        'dmypy', '--status-file', status_file_name, 'start', '--log-file', mypy_server_log_name,
        '--', '--show-column-numbers', '--show-error-end'
    ]
    process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = process.communicate()
  1. use command line to check
dmypy --status-file xxxx.json check -v xxx.py

It can output the correct result

  1. use python to write file,and use command line to check again
with open(path, 'w') as file:
    file.write(content)

It can not output any issue,like:

Success: no issues found in 1 source file
err                     : 
out                     : Success: no issues found in 1 source file\n
platform                :     darwin
python_version          :       3_11
roundtrip_time          :      1.148
stats                   : {'find_module_time': 0.006188869476318359, 'find_module_calls': 673, 'update_isolated_time': 0.0071163177490234375, 'propagate_time': 1.1365551948547363, 'find_changes_time': 0.00043392181396484375, 'fg_update_time': 6.198883056640625e-06, 'refresh_suppressed_time': 0.0006737709045410156, 'find_added_supressed_time': 0.0018012523651123047, 'cleanup_time': 1.1443119049072266}
status   
  1. BUT if I use mypy instead of dmypy,It can output correct result:
mypy xxx.py

Found 8 errors in 6 files (checked 1 source file)
err                     : 
out                     : c8f34f1c-8173-4437-b07f-8d7f8c7f7210/FLO ... 1725 more characters
platform                :     darwin
python_version          :       3_11
roundtrip_time          :      0.160
stats                   : {'validate_meta_time': 8.96453857421875e-05, 'files_parsed': 34, 'modules_parsed': 22, 'stubs_parsed': 12, 'parse_time': 0.01146078109741211, 'find_module_time': 0.01342916488647461, 'find_module_calls': 3688, 'semanal_time': 0.018131256103515625, 'typecheck_time': 0.014755964279174805, 'finish_passes_time': 0.007950305938720703, 'load_fg_deps_time': 1.5020370483398438e-05, 'update_isolated_time': 0.1284799575805664, 'propagate_time': 0.02331995964050293, 'find_changes_time': 0.0006420612335205078, 'fg_update_time': 0.1564321517944336, 'refresh_suppressed_time': 0.0005068778991699219, 'find_added_supressed_time': 0.0013458728790283203, 'cleanup_time': 0.0001461505889892578}
status                  :          1
  1. If I manually change the python file slightly,the dmypy can ouput correct result again

Your Environment

  • Mypy version used: 1.10.1

Is there anything special about the caching logic of this dmypy? Will all information be lost if the file is regenerated?

@WutingjiaX WutingjiaX added the bug mypy got something wrong label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant