Commit graph

5 commits

Author SHA1 Message Date
Benjamin Woodruff
194a930f64 Make BaseMetadataProvider[T] covariant over T
Because we'd consider `BaseMetadataProvider[int]` to be a subtype of
`BaseMetadataProvider[object]`, it should be covariant over its
typevar, rather than invariant.

This isn't entirely correct because we have a mutable data structure
(`_computed`) that depends on the typevar, and pyre points this out
(though with a really confusing error message). However, it's not
correct to say that `BaseMetadataProvider` is invariant either, so I
think this is the lesser evil.

I don't think it's practical to redesign this API to avoid the variance
issue, so I'm ignoring the new type error that results from this change.

I think this may resolve some of the issues we've seen internally with
D17820032.
2019-10-10 18:08:44 -07:00
Jennifer Taylor
8a8ea4b27b Upgrade Pyre to 0.32.
This fixes a TODO, removes several ignore statements and most importantly, addresses a massive speed regression triggered by importing matchers.
2019-10-04 11:05:37 -07:00
Jennifer Taylor
fb4785cfa1 Bump pyre version to 0.0.30.
This introduces a few new gotchas (namely attribute access and a bug with
Union[Callable]), but it also removes a whole host of pyre-fixmes and gets us
updated to a release of pyre that came out after May.
2019-09-25 12:04:33 -07:00
Jennifer Taylor
fc430343b5 Fix internal underscore convention.
Standardize on the convention that private modules (those we don't expect people to directly import) are prefixed with an underscore. Everything under a directory/module that has an underscore is considered private, unless it is re-exported from a non-underscored module. Most things are exported from libcst directly, but there are a few things in libcst.tool, libcst.codegen and libcst.metadata that are namedspaced as such.
2019-09-17 13:52:42 -07:00
Jimmy Lai
213b335cd5 move metadata providers its data structures to libcst.metadata 2019-09-16 19:53:22 -07:00
Renamed from libcst/metadata/dependent.py (Browse further)