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

race in record_missing_stub_packages (No such file or directory: '.mypy_cache/missing_stubs') #18283

Open
kalvdans opened this issue Dec 11, 2024 · 0 comments
Labels
bug mypy got something wrong topic-incremental

Comments

@kalvdans
Copy link

Bug Report

When running many mypy instances in parallel on the same project, our pipeline sometimes fails with the following traceback:

Traceback (most recent call last):
  File "/usr/local/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
             ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 102, in main
  File "mypy/main.py", line 186, in run_build
  File "mypy/build.py", line 193, in build
  File "mypy/build.py", line 296, in _build
  File "mypy/build.py", line 3539, in record_missing_stub_packages
FileNotFoundError: [Errno 2] No such file or directory: '.mypy_cache/missing_stubs'

To Reproduce

Run ten parallel mypy on 10 different files in your project from a cold start. Repeat until it fails.

Expected Behavior

That .mypy_cache/missing_stubs contains garbage or results from a random run. Or that there was a flag to disable missing_stubs writing.

Actual Behavior

See traceback above.

Your Environment

Ubuntu Linux running inside a docker container.

  • Mypy version used: mypy 1.12.0, mypy-extensions 1.0.0
  • Mypy command-line flags: mypy sourcefile.py
  • Mypy configuration options from mypy.ini (and other config files):
[tool.mypy]
mypy_path = "src"
disable_error_code = "import-untyped"

[[tool.mypy.overrides]]
module = [
  "secretpackage.secretmodule1",
  "secretpackage.secretmodule2",
]
follow_imports = "skip"
  • Python version used: 3.11 (didn't record minor version when it happened)
@kalvdans kalvdans added the bug mypy got something wrong label Dec 11, 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 topic-incremental
Projects
None yet
Development

No branches or pull requests

2 participants