Skip to content

--no-incremental still writes .mypy_cache #19489

@asottile-sentry

Description

@asottile-sentry

Bug Report

the help seems to indicate a cache will not be produced with --no-incremental:

$ mypy --help | grep -A2 no-inc
  --no-incremental          Disable module cache (inverse: --incremental)
  --cache-dir DIR           Store module cache info in the given folder in
                            incremental mode (defaults to '.mypy_cache')

a workaround is --cache-dir /dev/null though this isn't super portable

To Reproduce

print(1)
rm -rf .mypy_cache
mypy t.py --no-incremental
ls -ald .mypy_cache

Expected Behavior

$ rm -rf .mypy_cache
$ mypy t.py --no-incremental
Success: no issues found in 1 source file
$ ls -ald .mypy_cache
ls: cannot access '.mypy_cache': No such file or directory

Actual Behavior

$ rm -rf .mypy_cache
$ mypy t.py --no-incremental
Success: no issues found in 1 source file
$ ls -ald .mypy_cache
drwxr-xr-x 5 asottile wheel 160 Jul 22 07:36 .mypy_cache

Your Environment

  • Mypy version used: 1.17.0
  • Mypy command-line flags: --no-incremental
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions