Skip to content

Prevent dmypy from restarting if the configuration contains globs. #7960

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

Conversation

syastrov
Copy link
Contributor

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.

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.
@syastrov
Copy link
Contributor Author

I don't really think this is a "pretty" fix: it seems like self.glob_options is derived from per_module_options, so it should not be part of the snapshot. However, perhaps there is a better way to indicate which items should be part of the snapshot or not? (Perhaps all attributes starting with _ should be excluded, and we could rename it to self._glob_options).
But, since there was precedent in deleting per_module_cache from the snapshot, I just implemented it this way.

By the way, this bug is really nasty, because it is quite useful to ignore files in mypy.ini using globs and by doing that, it means the daemon always restarts.

@syastrov
Copy link
Contributor Author

I did a little refactor to make the attributes private as I commented above. You can choose to include the last commit or not depending on whether you think it makes sense.
With a little hackery, tests should now pass on Windows. I couldn't find a prettier way to do that.

@syastrov
Copy link
Contributor Author

OK, test is not passing on Windows. I don't have time to look at it right now, but am open to suggestions.

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

Otherwise this looks good.

@syastrov
Copy link
Contributor Author

It should be ready now

@msullivan msullivan merged commit 989626a into python:master Nov 21, 2019
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.

dmypy run keeps rerunning when using certain glob styles
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