Tags: pombredanne/pyre-check
Tags
search for binary under virtualenv directory correctly Summary: A common workflow is to create a venv, thusly: ``` python3 -m venv /tmp/pyre /tmp/pyre/bin/pip install pyre-check /tmp/pyre/bin/pyre start ``` Now, since `/tmp/pyre/bin` isn't in $PATH, we would miss out on the binary. Make pyre initialize and pyre smarter, and try to pick up on these binaries. This use case is particularly pertinent in OSS development. Reviewed By: grievejia Differential Revision: D15178027 fbshipit-source-id: 938c9d5e82b23bad5986f51bcb90760a2a4b8156
only support opam 2.0 Summary: As mentioned in facebook#142, opam 1.2 doesn't have recent package versions, and is unable to build Pyre. Reviewed By: grievejia Differential Revision: D15133329 fbshipit-source-id: eef93a8b9965c7a862637e0dedcc3de532409ff4
Using basic type partitioning for more principled isinstance checking Summary: This diff extends the ideas of D14545445 to apply to more than the special case of lists, and to work in the positive case as well. The average case we're trying to support here looks like this: ``` x: Union[int, Set[int]] if isinstance(x, set): # the runtime disallows using a parametric type here, and pyre will correctly interpret it as Set[Any] # x should be known to be List[int] else: # x should be known to be int ``` In theory, the positive case should be inferred to be `Intersection[previous type, asserted type]` and the negative case to be `Difference[previous type, asserted type]`. Without supporting these types first class, we can approximate them by opening up the unions (and implicit unions like Optional), and doing element-wise comparisons with the boundary. In order to support types with Anys, we need to use `is_consistent_with` rather than normal `less_or_equal`. Reviewed By: sinancepel Differential Revision: D15060401 fbshipit-source-id: 656b63a51b62d07e21f2c1b8fc700ca15b94a739
Add new query option (1/n) Summary: Adds a new query option regarding coverage in files, to be used in follow up diffs to build the color tool. Reviewed By: sinancepel Differential Revision: D14739329 fbshipit-source-id: a685b553219a5a62c771aeac8ebf00f1926bda86
Prevent truncation or loss of exception messages Summary: When the Pyre binary exists with an exception, it prints its status in a format that clearly will not follow our logger format. The previous code would fail to display these messages if a buffer had been flushed, or contained other information, preventing the client from displaying the line and essentially losing the message. Change the logic in the client so that lines that do not match our format are passed through without interpretation. This is the safest approach to prevent loss of any messages that we do not expect. Reviewed By: sinancepel, shannonzhu Differential Revision: D13832397 fbshipit-source-id: f4b42d3ff0b84e953be81b91bee6dc35735fc80e
v0.0.19
73CCfilter results in `_get_errors` instead of when printing Summary: Printing is too late. Filtering can affect behavior of the client (e.g. exit code) which potentially results in Pyre returning a non-zero exit code even though there aren't any type errors. Reviewed By: sinancepel Differential Revision: D13794530 fbshipit-source-id: 16bc1c0c08d02399b7ae3146cb648eae5a9aa1d8
Pyre strict should not suggest unknown attribute annotations Summary: Kill the useless (and confusing) part of error messages. If we don't know what the type is, don't try to suggest one. Note: Detail is also unnecessary here because the error itself is thrown at the location of the attribute definition, not where it's used (those are included in the evidence locations). Reviewed By: dark Differential Revision: D13226748 fbshipit-source-id: f1692ef67dbfa70200bce8a7b6d160029e4d833d
Remove inclusion of pyre errors in dependencies of target Summary: The idea of keeping all errors under a push blocking local configuration is actually fundamentally flawed. When running pyre on a set of targets, you'll get errors within that target and errors in the dependencies of that target; so if the project depends on anything push blocking, you'll see those errors too. This is problematic for two totally separate reasons: 1. This came up because an error was introduced into one world, and all of one world's reverse dependencies with differential=false were getting their diffs land blocked on that one world error. Sandcastle shells out to the local project and this one world dependency error is being returned as an error of the local project. Sandcastle will figure out what targets are affected by a diff and run pyre on all those projects if they are push blocking, but this dependency error was bypassing that system entirely. 2. **This is fundamentally flawed because we don't care about errors in dependencies.** We care about errors in *reverse dependences*. rdeps is the right way to do this, though we may want to hide it in a flag to avoid huge perf costs to buck building dependents if that's not what you care most about when running on the cmd line. We still want to filter by root of the local config, and want to keep this function around because implementing rdeps in the future. will mean we still need to determine a collection of local roots to filter by. This diff solves the frustrating push blocking issues for users; follow-up would look something like: T35566546 Reviewed By: dark Differential Revision: D10510665 fbshipit-source-id: 2c44ebfaa725159f2aa8e271174a01b0651ee7e9
PreviousNext