Repository navigation
add git (submodule) integrity check - #923
Conversation
If mypy is a git repository, check that the submodules are up-to-date (and abort if not) in runtests.py, scripts/mypy, setup.py. New option --dirty-stubs for runtests.py + scripts/mypy, for bypassing said check.
|
Good catch. Will use subprocess.check_output(cwd=...). |
|
I'd rather just have it warn the user rather than fail and requiring a bypass flag. |
It's easy to change. We'll see what developers want. Jukka (in #882) seemed to prefer for it to fail. |
'git submodule status' returns the current revision, not the revision in the superproject's index. Do an explicit retrieval of the latter using 'git ls-files'.
There was a problem hiding this comment.
Sounds like someone..."expelled" a directory or something. :) What about "the given directory"?
|
Thanks for implementing this! Looks good. I'll play around this with together with the submodule PR but I'll try to get this in as soon as possible to avoid the manual copying of changes between mypy and typeshed.
Let's start with failing. As Matthias mentioned, it's possible to miss the error, and if this turns out to be a burden then we can always reconsider it. People get quickly desensitized to errors and warnings.
I'd prefer to always abort if the submodule state is dirty. It just feels more consistent that way to me, and using a too recent submodule could cause problems. For example, it may use features that aren't supported by an older revision of mypy. |
There was a problem hiding this comment.
Should we ask the user to run git submodule update ... here as well, as otherwise the next try will also fail as the repo isn't cloned?
There was a problem hiding this comment.
Also, it would be nicer to have all commands on a single line (as git submodule init ... && git submodule update ...) for easier copy-paste (but only on a POSIX system). I guess it's safe to assume a sufficiently bash-like shell?
There was a problem hiding this comment.
Done.
Also, changed "git submodule init" to "git submodule update --init", which does both things at once.
This reverts commit 0456a92. (I did this in the wrong branch)
|
Thanks for the updates! I'll look at this again later this week when I have more time. |
If mypy is a git repository and has submodules, check that the submodules are initialized and up-to-date (and abort if not) in runtests.py, scripts/mypy, setup.py. Also check if they're dirty, and output a warning if so.
New option --dirty-stubs for runtests.py + scripts/mypy, for bypassing said checks.
This is a standalone PR. It doesn't depend on #884, or the other way around.
So you can merge them in any order.