Build layer typing fixes, part 2#15786
Open
dcbaker wants to merge 16 commits intomesonbuild:masterfrom
Open
Conversation
This makes the typing clearer, and avoids the need for a base class which adds effectively a private method.
This makes copying with types much easier than open coding this elsewhere.
This fixes some typing issues, as well as being more generically correct.
This makes it match BuildTarget, and removes another use of strings as sources below the Interpreter.
Mypy catches this for us.
Mypy should cover internal use cases, and the interpreter is fully typed now.
This removes some dead or should-be-dead code, mostly validation.
mypy can't tell that the `if preserve_path_from:` in the final inner loop will not be true for the GeneratedList case. We can avoid that case anyway, just add the files early and continue.
So that it can fulfill interface contracts.
…llback I don't understand why the one works but not the other with mypy and pylance, but it does
Again, we don't have strings, so it's perfectly safe to use iterable here, and we avoid the constant need to cast
39a4d22 to
29f0582
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the second piece of the series (cut roughly into thirds), to get the build.py layer mypy safe. With this series we're down to just 14 issues in build.py. I have the remaining patches to get us there in a branch, but wanted to continue to break this up to make review eaiser