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

dmypy run keeps rerunning when using certain glob styles #7576

Closed
rggjan opened this issue Sep 27, 2019 · 1 comment · Fixed by #7960
Closed

dmypy run keeps rerunning when using certain glob styles #7576

rggjan opened this issue Sep 27, 2019 · 1 comment · Fixed by #7960
Assignees
Labels
bug mypy got something wrong priority-1-normal topic-daemon dmypy

Comments

@rggjan
Copy link

rggjan commented Sep 27, 2019

With a configfile like this:

...
[mypy-abc.*]
...

dmypy run works fine, and only reruns when the configfile changes.

However, when I change the module configuration to:

...
[mypy-abc.*.abc]
...

dmypy keeps rerunning, saying:

Restarting: configuration changed
Daemon stopped
Daemon started

even without further changes to the config file.

I tried to track the error down, and changed the error message indmypy_server.py to:

    def cmd_run(self, version: str, args: Sequence[str],
                is_tty: bool, terminal_width: int) -> Dict[str, object]:
        """Check a list of files, triggering a restart if needed."""
            ...
            # Signal that we need to restart if the options have changed
            if self.options_snapshot != options.snapshot():
                return {'restart': 'configuration changed' + str(self.options_snapshot) + '===' + str(options.snapshot())}
            ...

Comparing self.options_snapshot with options.snapshot(), I can see that with the second config file, self.options_snapshot contains this:

'glob_options':
[('abc.*.abc',
re.compile('abc(\\..*)?\\.abc\\Z'))],

while options.snapshot() contains this:

'glob_options':
[],

So I believe something is wrong in this case...

@ilevkivskyi
Copy link
Member

Thanks for report and the detailed analysis!

@ilevkivskyi ilevkivskyi added bug mypy got something wrong priority-1-normal topic-daemon dmypy labels Sep 27, 2019
syastrov added a commit to syastrov/mypy that referenced this issue Nov 16, 2019
If a configuration contains globs, then dmypy incorrectly detected
that the configration changed even though it did not.
This caused the daemon to always restart if a configuration contained globs.

Fixes python#7576.
msullivan pushed a commit that referenced this issue Nov 21, 2019
…7960)

If a configuration contains globs, then dmypy incorrectly detected
that the configration changed even though it did not.
This caused the daemon to always restart if a configuration contained globs.

Fixes #7576.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-1-normal topic-daemon dmypy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants