Project: use list of paths instead of pyright_cmd#135
Closed
sharkdp wants to merge 1 commit intohauntsaninja:masterfrom
Closed
Project: use list of paths instead of pyright_cmd#135sharkdp wants to merge 1 commit intohauntsaninja:masterfrom
pyright_cmd#135sharkdp wants to merge 1 commit intohauntsaninja:masterfrom
Conversation
pyright_cmd
143df30 to
edc5cc5
Compare
hauntsaninja
added a commit
that referenced
this pull request
Apr 18, 2025
Supersedes #135 This PR should be a no-op, but I'll also go through the "{pyright}" cases as well
Owner
|
Sorry for the delay! This has run into some merge conflicts; I fixed up and took a slightly different approach in #151. Let me know what you think! |
hauntsaninja
added a commit
that referenced
this pull request
Apr 18, 2025
Supersedes #135 This PR should be a no-op, but I'll also go through the "{pyright}" cases as well
sharkdp
added a commit
to astral-sh/ruff
that referenced
this pull request
Apr 22, 2025
## Summary Switch to the official version of [`mypy_primer`](https://github.com/hauntsaninja/mypy_primer), now that Red Knot support has been upstreamed (see hauntsaninja/mypy_primer#138, hauntsaninja/mypy_primer#135, hauntsaninja/mypy_primer#151, hauntsaninja/mypy_primer#155). ## Test Plan Locally and in CI
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.
Thank you for creating
mypy_primer! As of recently, we use it to run test Red Knot against (a small subset of) ecosystem projects. So far, we use a fork ofmypy_primer, but I would like to clean up our implementation, add some improvements, and potentially upstream some of the changes — if you are interested.As a first step, I would like to propose a change to the
Projectdataclass. So far, it stores a custommypy_cmdand apyright_cmd. I've noticed that thepyright_cmdin particular only comes in three variants:pyright_cmd=None— which means that Pyright shouldn't run for this projectpyright_cmd="{pyright}"— which means that Pyright should be executed without passing any explicit pathspyright_cmd="{pyright} some relative paths"— which means that the command line includes a list of explicit paths that are passed to Pyright.In particular, there are no
pyright_cmdfields that pass additional flags to pyright.For running other type checkers, it would be beneficial to have that information in a more structured form. This way we could reuse the list of explicit paths. So I'm proposing the following change:
pyright_cmd=None, we add a new flagpyright_skip=True.pyright_cmd="{pyright}", we simply remove thatpyright_cmdparameter. We consider that to be the new default.pyright_cmd="{pyright} some relative paths", we also remove thepyright_cmdparameter and add a newpaths=["some", "relative", "paths"]field.I have not attempted to change the representation for mypy, but I could do so if it seems desirable. I'd like to discuss the general approach first.
I tested this by running