Skip to content

sync: pyright 2023 04 03 #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 684 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
684 commits
Select commit Hold shift + click to select a range
cce89d8
Updated typeshed stubs to the latest version.
msfterictraut Jan 28, 2023
248e5bd
Updated code complexity calculation in binder to take into account th…
msfterictraut Jan 29, 2023
95315d1
Fixed broken test case.
msfterictraut Jan 29, 2023
7d65fa6
Fixed a bug that resulted in incorrect type narrowing for discriminat…
msfterictraut Jan 29, 2023
38f2cea
Fixed grammar in diagnostic message.
msfterictraut Jan 29, 2023
50fadd7
Fixed bug in command-line version of pyright that led to the inclusio…
msfterictraut Jan 29, 2023
e5fd048
Improved type narrowing for truthy tests that involve `int`, `str` or…
msfterictraut Jan 29, 2023
16b5b9a
Fixed bug that resulted in a false positive when trying to assign a v…
msfterictraut Jan 30, 2023
0176543
Fixed a bug that led to a false negative when a backslash character w…
msfterictraut Jan 30, 2023
88a32c7
[PylanceBot] Pull Pylance with Pyright 1.1.291 (#4554)
PylanceBot Jan 30, 2023
a503d72
Modified overload matching algorithm to more closely match that of my…
msfterictraut Jan 31, 2023
3a97d02
Fixed a bug in the handling of file specs (globs) used for the "inclu…
msfterictraut Jan 31, 2023
27211b8
Disabled type narrowing for expressions of the form "<literal> == X" …
msfterictraut Jan 31, 2023
6df39e4
Changed speculative type cache to return full cache entry in prep for…
msfterictraut Jan 31, 2023
1d461ea
Addressed performance issue in code that includes loops and many inte…
msfterictraut Jan 31, 2023
bee1466
Fixed a bug that led to a false positive error about an "unknown type…
msfterictraut Feb 1, 2023
e4e08c3
Published 1.1.292
msfterictraut Feb 1, 2023
f8eb114
Fixed a few typos in the pyright documentation.
msfterictraut Feb 1, 2023
e0799d8
Fixed a bug that resulted in incorrect type evaluation when accessing…
msfterictraut Feb 1, 2023
c1ea8b3
pull from pylance feb1 (#4565)
bschnurr Feb 1, 2023
cca7588
Fixed a regression that resulted in a crash when resolving overloads …
msfterictraut Feb 1, 2023
b3ff34f
Marked PEP 698 as no longer "draft" since it was accepted.
msfterictraut Feb 2, 2023
cb2c338
Fixed a bug that resulted in an inconsistent "import not accessed" di…
msfterictraut Feb 2, 2023
d1a8be7
Tweaked the "type complexity" heuristic to produce more intuitive res…
msfterictraut Feb 2, 2023
dbc5c42
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#4578)
dependabot[bot] Feb 3, 2023
6078f13
Added specialized logic to better handle imports of the form `from .x…
msfterictraut Feb 3, 2023
3a8155d
modifying class and function signatures to make them more textmate co…
bschnurr Feb 3, 2023
dd08483
Improved handling of a class declaration that uses a dynamic unpacked…
msfterictraut Feb 3, 2023
a822ae5
[PylanceBot] Pull Pylance with Pyright 1.1.292 (#4581)
PylanceBot Feb 3, 2023
f4d022b
Fixed a bug that resulted in a false positive error and incorrect typ…
msfterictraut Feb 4, 2023
fa88fbd
Fixed false negative bug when checking for valid use of identifiers w…
msfterictraut Feb 4, 2023
9dabb3a
Fixed a bug that led to a false positive error when a magic method (s…
msfterictraut Feb 4, 2023
8632688
Simplified typeVarContext by combining tuple types into main TypeVar …
msfterictraut Feb 4, 2023
e6fbf54
Added error for a dataclass that uses a private attribute name that a…
msfterictraut Feb 5, 2023
4923327
Implemented support for overloaded functions captured by a ParamSpec.…
msfterictraut Feb 5, 2023
a0e8092
Fixed bug that resulted in a false positive when using a ParamSpec wi…
msfterictraut Feb 7, 2023
8b0c725
Updated typeshed stubs to the latest.
msfterictraut Feb 7, 2023
06e7509
Fixed bug in signature help that resulted in incorrect or misleading …
msfterictraut Feb 7, 2023
ceb2a2d
Published 1.1.293
msfterictraut Feb 8, 2023
f3a7ba7
Fixed a bug that led to a false positive error when using a type alia…
msfterictraut Feb 8, 2023
4eb4397
Updated documentation for default exclude settings.
msfterictraut Feb 8, 2023
dec6aa2
[PylanceBot] Pull Pylance with Pyright 1.1.293 (#4595)
PylanceBot Feb 8, 2023
e7e19af
Fixed a false negative where a variable used within a `TypeAlias` def…
msfterictraut Feb 9, 2023
2191a20
Fixed false negative error where an attempt to assign a value of type…
msfterictraut Feb 10, 2023
5d735d4
Fixed a bug that results in a false positive error when using `Self` …
msfterictraut Feb 10, 2023
06917bb
Removed typeshed tensorflow stubs because they're too incomplete at t…
msfterictraut Feb 10, 2023
662bcb5
Use binary search in findNodeByOffset if we can. (#4607)
heejaechang Feb 10, 2023
67d2331
Completions and signature help for PEP 692 (#4599)
rchiodo Feb 11, 2023
76d1839
Bump cacheable-request from 10.2.2 to 10.2.7 (#4612)
dependabot[bot] Feb 11, 2023
8caefa5
Change dataClassFieldWithDefault from error to diagnostic (#4614)
debonte Feb 11, 2023
d40c156
Fixed bug that resulted in a false positive error when calling `type(…
msfterictraut Feb 12, 2023
13492d8
Improved error handling for constructor call to `NoneType`.
msfterictraut Feb 12, 2023
bf7f326
Fixed bug that led to incorrect type evaluation when a yield statemen…
msfterictraut Feb 13, 2023
9e585a6
Added error reporting for malformed `# pyright` comments. This addres…
msfterictraut Feb 14, 2023
344b091
Minor formatting improvements to documentation.
msfterictraut Feb 15, 2023
ab7fa64
Push pylance changes to pyright (#4639)
bschnurr Feb 15, 2023
7be253b
Fixed a bug that resulted in a false positive when accessing an insta…
msfterictraut Feb 15, 2023
58f6824
Published 1.1.294
msfterictraut Feb 15, 2023
085dfbf
Updated the handling of type narrowing for class pattern matching in …
msfterictraut Feb 15, 2023
5162b3d
Fixed a bug that led to false positive errors when evaluating compari…
msfterictraut Feb 15, 2023
36e9e44
Added logic to exempt a `self` with annotated type `Never` from the c…
msfterictraut Feb 17, 2023
7fc77ec
Fixed a bug that resulted in an incorrect inferred function return ty…
msfterictraut Feb 17, 2023
453e3b2
Fixed a bug that caused a `Final` variable to lose its literal value …
msfterictraut Feb 19, 2023
d22850b
Fixed a bug that resulted in a false positive "overlapping overload" …
msfterictraut Feb 20, 2023
d62aff2
Fixed a bug that resulted in a false positive diagnostic when using a…
msfterictraut Feb 20, 2023
ea23ba5
Fixed issue that caused the type of `None.__class__` to be evaluated …
msfterictraut Feb 21, 2023
8024a16
Fixed test case that was broken by changes in typeshed definition of …
msfterictraut Feb 21, 2023
6017cda
Updated typeshed stubs to the latest.
msfterictraut Feb 21, 2023
28ef5bc
Added parameter documentation on hover from function docString (#4655)
drbrady8800 Feb 21, 2023
f4aae1a
Fixed bug that resulted in incorrect type evaluation when a `__new__`…
msfterictraut Feb 22, 2023
f5e43ca
Published 1.1.295
msfterictraut Feb 22, 2023
e411e53
[PylanceBot] Pull Pylance with Pyright 1.1.295 (#4675)
PylanceBot Feb 22, 2023
ae13a42
Fixed a bug that resulted in a false positive when determining the co…
msfterictraut Feb 22, 2023
1ae69d2
Improved type inference of method calls on `super()` so `Self` is gen…
msfterictraut Feb 22, 2023
19d440b
Fixed a bad comment.
msfterictraut Feb 23, 2023
062aadc
Fixed regression in import resolver that resulted in spurious "stub n…
msfterictraut Feb 23, 2023
31ba5a7
Fixed a bug that resulted in incorrect type evaluation of augmented a…
msfterictraut Feb 23, 2023
b7e3004
Addressed a performance issue that resulted in long evaluation times …
msfterictraut Feb 23, 2023
773a7cd
pull-pylance-with-pyright-1.1.295 (#4682)
PylanceBot Feb 23, 2023
d424fdf
Improved support for ternary expressions that use a statically-evalua…
msfterictraut Feb 24, 2023
a9f299c
Enhanced the `reportUnnecessaryComparison` to check for unused patter…
msfterictraut Feb 24, 2023
dbda7d4
Actions to publish to VS Code Marketplace (#4676)
debonte Feb 24, 2023
d53ae96
Fixed bug that caused a false positive when a variable of type `type`…
msfterictraut Feb 25, 2023
30893e5
Consolidated some special-case logic for detecting implicit class met…
msfterictraut Feb 25, 2023
438ca5f
Changed logic to treat `self` and `cls` parameters as positional-only…
msfterictraut Feb 25, 2023
5e96c7b
Fixed bug that resulted in a false positive error with `assert_type` …
msfterictraut Feb 26, 2023
90e70c3
Updated typeshed stubs to the latest version.
msfterictraut Feb 26, 2023
526d907
Slimmed down the README to remove information that most pyright users…
msfterictraut Feb 26, 2023
2750062
Pedantic clarification on ALE support (#4698)
mzat-msft Feb 27, 2023
712d560
Added diagnostic check for when unknown or partially-unknown type is …
msfterictraut Feb 27, 2023
9b0127c
added module name to moduleUnknownMember diagnostic to help inform wh…
bschnurr Feb 27, 2023
2857963
add gitlab ci documentation (#4704)
ErezAmihud Feb 27, 2023
85c043d
Improved performance by not inferring return type of overloaded imple…
msfterictraut Feb 28, 2023
8c79c1b
Published 1.1.296
msfterictraut Feb 28, 2023
55c917a
Extended logic that searches for `site-packages` directory within a v…
msfterictraut Mar 1, 2023
c458d16
Added support for bidirectional type inference for dictionary express…
msfterictraut Mar 1, 2023
bea6040
Fixed a bug that led to a false positive error when using the `|` ope…
msfterictraut Mar 1, 2023
e2f8a73
Fixed a recent regression that resulted in an incorrect type evaluati…
msfterictraut Mar 1, 2023
2ce319c
Implemented missing check for generic type alias specialization when …
msfterictraut Mar 1, 2023
569b5dc
Fixed a bug that resulted in a false negative when defining a generic…
msfterictraut Mar 1, 2023
02b4c17
Added logic to detect when a type alias is used in a generic class de…
msfterictraut Mar 1, 2023
7ef5bf8
Declare workspaceFolders support in server capabilities (#4666)
the-mikedavis Mar 1, 2023
3c72a37
Performance optimization: reduced formatting of error messages in cas…
msfterictraut Mar 1, 2023
124334d
Fixed a bug that caused the variance for type parameters to be incorr…
msfterictraut Mar 1, 2023
93a4ef8
[PylanceBot] Pull Pylance with Pyright 1.1.296 (#4716)
PylanceBot Mar 1, 2023
ac3487e
Fix indented code blocks in docstrings (#4717)
gracepetryk Mar 2, 2023
81f21ee
Added support for type guard patterns `type(x) == T` and `type(x) != …
msfterictraut Mar 2, 2023
7035c83
Made first steps toward moving Final and TypeAlias processing out of …
msfterictraut Mar 2, 2023
963d80b
Fixed misspelled function name in completion provider. No functional …
msfterictraut Mar 2, 2023
edfe2aa
Improved error handling for dictionary expressions that use bidirecti…
msfterictraut Mar 3, 2023
659fdfa
Improved handling of `typing.TypeAlias` so it can be aliased and re-e…
msfterictraut Mar 2, 2023
3035662
If no files are found and no errors are detected but the `--outputjso…
msfterictraut Mar 3, 2023
f8ce7ca
Made JSON parsing stricter for the pyrightconfig.json file. Previousl…
msfterictraut Mar 3, 2023
0537172
Removed some unused fields.
msfterictraut Mar 3, 2023
0a206e8
Removed the need for the binder to understand `typing.Required` and …
msfterictraut Mar 3, 2023
364cb03
Fixed a bug that resulted in an incorrect reporting of "unreachable c…
msfterictraut Mar 4, 2023
a36c24c
Fixed recent regression that caused incorrect behavior when `Required…
msfterictraut Mar 4, 2023
58db719
Fixed performance issue that affected long if/elif chains. This addre…
msfterictraut Mar 5, 2023
9281721
Fixed bug that resulted in incorrect type evaluation of arguments to …
msfterictraut Mar 5, 2023
6910128
Changed import modeling behavior for import statements with multi-par…
msfterictraut Mar 5, 2023
dbe9e3a
Fixed misspelling in variable name.
msfterictraut Mar 5, 2023
315031a
Fixed a bug that led to a false positive error when using a subclass …
msfterictraut Mar 6, 2023
f82de84
Changed `reportSelfClsParameterName` check to accept `mcs` and `mcls`…
msfterictraut Mar 6, 2023
bafc4d0
Added common routine for determining whether a type is a metaclass in…
msfterictraut Mar 6, 2023
7197a8d
Added documentation for import statements.
msfterictraut Mar 6, 2023
735c19a
Improved documentation for `...` function bodies.
msfterictraut Mar 6, 2023
5180be8
Fixed bug that resulted in the incorrect type evaluation for a functi…
msfterictraut Mar 6, 2023
6f07019
Switched from a map to a set in type verifier. No functional change.
msfterictraut Mar 6, 2023
f8edba0
Fixed regression in `--verifytypes` where variables assigned from cal…
msfterictraut Mar 6, 2023
09161fd
Added an error message for `Concatenate` if a `TypeVarTuple` is used …
msfterictraut Mar 6, 2023
b3fd962
Fixed bugs in documentation.
msfterictraut Mar 6, 2023
4c4aec5
Added support for docsify-based docs site.
msfterictraut Mar 6, 2023
fe4eec0
Added link to new documentation on main README.
msfterictraut Mar 6, 2023
b61f121
Minor tweak to README.
msfterictraut Mar 6, 2023
6cb2f4a
Moved installation instructions and FAQ to their own docs pages, furt…
msfterictraut Mar 6, 2023
f7be9cc
A few more README tweaks.
msfterictraut Mar 6, 2023
dc87fa4
Added a missing HTML tag to index.html.
msfterictraut Mar 6, 2023
2827c94
Small correction to settings documentation.
msfterictraut Mar 6, 2023
deabba5
Tweaked documentation theming and added language highlighting for json.
msfterictraut Mar 7, 2023
65874c5
Small tweak for main docs page.
msfterictraut Mar 7, 2023
2c4a9da
More tweaks to documentation and README files. Added a navbar to docs…
msfterictraut Mar 7, 2023
400dd26
Another small tweak to docs sidebar.
msfterictraut Mar 7, 2023
8f17673
Fixed main Pyright link in sidebar.
msfterictraut Mar 7, 2023
f7db582
Ran auto-formatter on html to avoid style issue in CI.
msfterictraut Mar 7, 2023
08b2cb4
Did a consistency pass on documentation markdown.
msfterictraut Mar 7, 2023
a00a026
Fixed capitalization inconsistency in docs.
msfterictraut Mar 7, 2023
d3b15d1
Fixed a bug whereby the signature help and hover text for an overload…
msfterictraut Mar 7, 2023
7c2205b
Added check and corresponding error for use of an unpacked tuple in a…
msfterictraut Mar 7, 2023
32a29fb
Fixed several bugs relating to types of callables (functions, methods…
msfterictraut Mar 7, 2023
4bc7c6e
Removed the old dataclass_transform spec.
msfterictraut Mar 7, 2023
1fdeade
Improved "getting started" documentation.
msfterictraut Mar 7, 2023
414dce1
Updated documentation for import modeling differences between mypy an…
msfterictraut Mar 7, 2023
a8753c7
Small code cleanup — added options interface for getTypeArgs function.
msfterictraut Mar 7, 2023
8e56215
Added experimental support for inlined TypedDict definitions using th…
msfterictraut Mar 7, 2023
c83a95e
More improvements to documentation.
msfterictraut Mar 7, 2023
d016ff4
Published 1.1.297
msfterictraut Mar 8, 2023
dd9fa29
Fixed a regression that resulted in a false positive in some rare cas…
msfterictraut Mar 8, 2023
da2498b
Changed implementation for `@typing.deprecated` so the code doesn't a…
msfterictraut Mar 8, 2023
92c32b0
Updated typeshed to the latest stubs.
msfterictraut Mar 8, 2023
574fc59
Published 1.1.298
msfterictraut Mar 8, 2023
adc46d3
pull-pylance-with-pyright-1.1.298 (#4745)
PylanceBot Mar 8, 2023
f61304e
Fixed bug that caused incorrect evaluation of numeric literals expres…
msfterictraut Mar 9, 2023
9c6ebad
Updated mypy comparison to reflect change in mypy's type narrowing ca…
msfterictraut Mar 9, 2023
ec8f6fd
Fixed display issue with name of module when it is imported implicitl…
msfterictraut Mar 9, 2023
3f987e3
Fixed broken links in README for npmjs page. Added missing link to co…
msfterictraut Mar 9, 2023
65ca325
Changed `# pyright: basic` file-level comment so it overrides "strict…
msfterictraut Mar 9, 2023
65fc732
Fixed a recent regression that resulted in multi-part imports being e…
msfterictraut Mar 10, 2023
128e169
Fixed regression that led to a false positive error in some cases whe…
msfterictraut Mar 11, 2023
7c23b1a
Updated logic for PEP 696 (TypeVarLike "defaults") to change the synt…
msfterictraut Mar 11, 2023
a28fb5d
Fixed bug that caused incorrect results with `--verifytypes` when `Ne…
msfterictraut Mar 12, 2023
ce66cc2
Fixed a bug that led to a false negative when a non-Generic class has…
msfterictraut Mar 13, 2023
c272a60
Fixed a bug that led to incorrect "circular reference" error for a ty…
msfterictraut Mar 14, 2023
ac9b89c
Published 1.1.299
msfterictraut Mar 15, 2023
cebfc31
Bump webpack from 5.75.0 to 5.76.0 in /packages/pyright (#4774)
dependabot[bot] Mar 15, 2023
6de7375
Push pylance changes to pyright (#4783)
debonte Mar 16, 2023
2ca9a8a
Fixed regression that resulted in a false positive error when using a…
msfterictraut Mar 16, 2023
99c73a0
Performance: sped up type analyzer by 5-25% by caching types that hav…
msfterictraut Mar 16, 2023
c7ab804
Performance: Further improved perf when determining type compatibilit…
msfterictraut Mar 16, 2023
e2e3a5c
Added new diagnostic check `reportImplicitOverride`. This addresses h…
msfterictraut Mar 16, 2023
425908e
Fixed bug that resulted in a false positive error relating to varianc…
msfterictraut Mar 16, 2023
0997c33
Fixed regression that caused a crash in the presence of the illegal s…
msfterictraut Mar 16, 2023
c7c7035
Changed the logic in the code flow engine so it never attempts to inf…
msfterictraut Mar 17, 2023
9af43f2
Fixed bug that resulted in a crash when user types `import` without a…
msfterictraut Mar 17, 2023
34e12fc
Added support for `clear` and `popitem` methods on TypedDict instance…
msfterictraut Mar 17, 2023
cb9952a
Improved hover text for methods that are synthesized (e.g. the `get` …
msfterictraut Mar 17, 2023
68a8e98
pull-pylance-with-pyright-1.1.299 (#4797)
PylanceBot Mar 17, 2023
1af9bf8
fixed missing imports inside try/catch blocks when createTypeStub com…
bschnurr Mar 17, 2023
575adcb
Fixed a bug that can result in infinite recursion (and a subsequent c…
msfterictraut Mar 17, 2023
7ad4a8e
Added support for `@deprecated` in an `__init__` method when construc…
msfterictraut Mar 19, 2023
d36c524
Fixed a couple of bugs in the type narrowing logic for class pattern …
msfterictraut Mar 19, 2023
b9e72bf
Improved consistency of type narrowing on assignment when the target …
msfterictraut Mar 19, 2023
2526731
Updated typeshed stubs to the latest version.
msfterictraut Mar 19, 2023
54dbe9a
Fixed a bug that led to the incorrect type resolution for unsupported…
msfterictraut Mar 20, 2023
d860256
Extended support for reportUnnecessaryComparison check to handle data…
msfterictraut Mar 20, 2023
bc15a7b
Fixed a couple of misspellings in comments. No functional change.
msfterictraut Mar 21, 2023
23cac90
Added small simplification and performance improvement in code path t…
msfterictraut Mar 21, 2023
ae873e4
Fixed regression that resulted in internal corrupt state and odd beha…
msfterictraut Mar 21, 2023
3ae66f2
Fixed a recent regression that resulted in a false positive error whe…
msfterictraut Mar 21, 2023
f9a7382
Published 1.1.300
msfterictraut Mar 22, 2023
0447197
pull-pylance-with-pyright-1.1.300 (#4816)
PylanceBot Mar 22, 2023
56c6edd
Fixed bug that caused diagnostic for implicit override to be reported…
msfterictraut Mar 22, 2023
8d9ad79
Fixed recent regression that caused a crash in the signature help pro…
msfterictraut Mar 22, 2023
02e3e96
Fixed bug that resulted in false positive "incompatible variance" err…
msfterictraut Mar 22, 2023
903fd3c
Added support for argument dictionary unpacking when the type of the …
msfterictraut Mar 22, 2023
cca8ce8
Fixed a bug that led to the incorrect evaluation of a symbol imported…
msfterictraut Mar 22, 2023
968ffc9
Revert "Fixed a bug that led to the incorrect evaluation of a symbol …
msfterictraut Mar 22, 2023
98e2134
Reduced verbosity of CLI output for non-error conditions.
msfterictraut Mar 23, 2023
e7668ae
Added support for a TypeGuard function where the first argument is a …
msfterictraut Mar 23, 2023
f630692
Fixed a bug that led to the incorrect evaluation of a symbol imported…
msfterictraut Mar 24, 2023
8a93373
Added support for "naked" `ClassVar` used to annotate a class variabl…
msfterictraut Mar 24, 2023
14f4587
Added support for synthesized `__slots__` symbol in dataclasses that …
msfterictraut Mar 25, 2023
95d4809
Fixed bug that resulted in an false positive error when using a class…
msfterictraut Mar 25, 2023
47efdfc
Fixed a bug that resulted in a false negative when using a type varia…
msfterictraut Mar 25, 2023
5cf4aed
Did a pass over pyright source code to improve consistency of file he…
msfterictraut Mar 26, 2023
7e818af
Fixed bug that resulted in a false positive error when doing protocol…
msfterictraut Mar 27, 2023
14b0831
Fix Markdown links (#4849)
Molkree Mar 28, 2023
2ae51d2
Tweaked the type constraint solver's "scoring" mechanism to ensure th…
msfterictraut Mar 28, 2023
6e43a0f
Fixed issue that resulted in unnecessary caching (and therefore unnec…
msfterictraut Mar 28, 2023
1d03f54
Fixed a bug that resulted in spurious type evaluation errors when dea…
msfterictraut Mar 28, 2023
82d3419
Don't modify `Comment` range data (#4858)
debonte Mar 28, 2023
c0b4ef2
Fixed bug that led to a false positive error when a TypeVar was bound…
msfterictraut Mar 29, 2023
a218860
Published 1.1.301
msfterictraut Mar 29, 2023
17b05d7
Fixed bug that resulted in a false positive "partially unknown" error…
msfterictraut Mar 29, 2023
4733545
Fixed regression in CLI version that caused the default `stubsPath` v…
msfterictraut Mar 29, 2023
d761610
pull-pylance-with-pyright-1.1.301 (#4865)
PylanceBot Mar 29, 2023
3f8802f
Made code consistency change in properties.ts module. No functional c…
msfterictraut Mar 30, 2023
0d16b95
Fixed a bug that caused an overload function with a missing return ty…
msfterictraut Mar 30, 2023
e37512a
Added support for negative (fall-through) type narrowing for mapping …
msfterictraut Mar 30, 2023
09c79ed
Fixed bug in constraint solver that results in incorrect code being e…
msfterictraut Mar 30, 2023
ee851cf
Fixed bug that led to inconsistent behaviors when attempting to assig…
msfterictraut Mar 31, 2023
f1db884
Added support for type guards of the form `x[I] is B` and `x[I] is no…
msfterictraut Mar 31, 2023
0808547
Extended type narrowing for type guards of the form `x[I] is B` and `…
msfterictraut Mar 31, 2023
1a0731e
Changed `reportImplicitOverride` check to exempt `__init__` and `__ne…
msfterictraut Mar 31, 2023
e7f418a
Implemented PEP 698 (@override) support for methods decorated with `@…
msfterictraut Mar 31, 2023
cb86678
Fixed a bug that resulted in a false negative when a `self` or `cls` …
msfterictraut Mar 31, 2023
a37e259
Fixed a bug that led to a false positive error when evaluating a call…
msfterictraut Apr 1, 2023
ba204e3
Fixed style issue.
msfterictraut Apr 1, 2023
d8f878c
Fixed errant comment in test case.
msfterictraut Apr 2, 2023
523762d
Fixed an issue that resulted in an unnecessary use of memory when tra…
msfterictraut Apr 2, 2023
15b47ae
Fixed a bug that led to a false positive when a generic function was …
msfterictraut Apr 2, 2023
44199ee
Changed the evaluated type of an exception group from `ExceptionGroup…
msfterictraut Apr 2, 2023
d2a6b79
Improved type inference for unpacking of tuples that include unpacked…
msfterictraut Apr 2, 2023
ff134e6
Added documentation to mypy comparison that talks about narrowing for…
msfterictraut Apr 2, 2023
8f401e3
Fixed a bug that led to a false positive error when calling a constru…
msfterictraut Apr 2, 2023
55f035a
Fixed bug that resulted in a false negative when `Never` is used as a…
msfterictraut Apr 3, 2023
fac5427
Revert "when indexing is off, include import alias from user files" (…
bschnurr Apr 3, 2023
54f74e6
sync pyright
tjdevries Apr 3, 2023
f13355f
fixup: package json
tjdevries Apr 3, 2023
f1b779c
fixup: fix snapshots and type errors
tjdevries Apr 3, 2023
a6e61dd
fixup: move dep to scip pyright
tjdevries Apr 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Build'

env:
NODE_VERSION: '16' # Shipped with VS Code.
ARTIFACT_NAME_VSIX: vsix
VSIX_NAME: vscode-pyright.vsix

on:
push:
tags:
- '1.1.[0-9][0-9][0-9]'

jobs:
build:
if: github.repository == 'microsoft/pyright'
runs-on: ubuntu-latest
name: Build

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get npm cache directory
id: npm-cache
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm run install:all

- name: Build VSIX
working-directory: packages/vscode-pyright
run: |
npm run package
mv pyright-*.vsix ${{ env.VSIX_NAME }}

- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME_VSIX }}
path: packages/vscode-pyright/${{ env.VSIX_NAME }}

create_release:
if: github.repository == 'microsoft/pyright'
runs-on: ubuntu-latest
name: Create release
needs: [build]

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts

# TODO: If the release already exists (tag created via the GUI), reuse it.
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Published ${{ github.ref_name }}
draft: true
artifacts: ./artifacts/${{ env.ARTIFACT_NAME_VSIX }}/${{ env.VSIX_NAME }}
artifactContentType: application/zip
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Release

on:
release:
types: [published]

env:
VSIX_NAME: vscode-pyright.vsix
NODE_VERSION: '16' # Shipped with VS Code.

jobs:
publish_extension:
if: ${{ github.repository == 'microsoft/pyright' }}
runs-on: ubuntu-latest
name: Publish extension to marketplace

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm install

- name: Download VSIX
uses: i3h/download-release-asset@v1
with:
owner: microsoft
repo: pyright
tag: ${{ github.event.release.tag_name }}
file: ${{ env.VSIX_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}

# https://code.visualstudio.com/api/working-with-extensions/publishing-extension
- name: Install VSCE
run: |
npm install -g "vsce@$(jq -r '.dependencies.vsce.version' < packages/vscode-pyright/package-lock.json)"
npx vsce --version

# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token
- name: Publish VSIX
run: npx vsce publish --packagePath ${{ env.VSIX_NAME }} --pat ${{ secrets.VSCE_TOKEN }} --noVerify
24 changes: 12 additions & 12 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:
name: Typecheck

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -45,17 +45,17 @@ jobs:
name: Style

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -80,9 +80,9 @@ jobs:
needs: typecheck

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

Expand All @@ -93,7 +93,7 @@ jobs:
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
if: runner.os != 'Windows'
with:
path: ${{ steps.npm-cache.outputs.dir }}
Expand All @@ -113,17 +113,17 @@ jobs:
needs: typecheck

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
]
},
{
"name": "Pyright extension (watch)",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/packages/vscode-pyright/dist/extension.js",
"preLaunchTask": "Watch extension",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode-pyright",
// The published extension is named "ms-pyright.pyright", but in debug mode it's "ms-pyright.vscode-pyright"
// to allow the extension code to participate in the lerna monorepo. Make sure that the published extension
// isn't enabled, otherwise both are loaded and conflict.
"--disable-extension=ms-pyright.pyright"
],
"smartStep": true,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/packages/vscode-pyright/dist/**/*.js"
]
},
{
"name": "Pyright attach server",
"type": "node",
Expand Down
23 changes: 11 additions & 12 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
"fileLocation": "absolute",
"pattern": [
{
"kind": "location",
"regexp": "(ERROR|WARNING) in (.*?):(\\d+):(\\d+)",
"severity": 1,
"file": 2,
"line": 3,
"column": 4
},
{
"regexp": "\\s*(@typescript-eslint\\/.+):\\s*(.*)$",
"code": 1,
"message": 2
}
"regexp": "\\[tsl\\] (ERROR|WARNING) in (.*)?\\((\\d+),(\\d+)\\)",
"severity": 1,
"file": 2,
"line": 3,
"column": 4
},
{
"regexp": "\\s*TS(\\d+):\\s*(.*)$",
"code": 1,
"message": 2
}
],
"background": {
"activeOnStart": true,
Expand Down
2 changes: 1 addition & 1 deletion build/checkLockIndent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
//@ts-check

// Lerna doesn't do a good job preserving the indention in lock files.
// Lerna doesn't do a good job preserving the indentation in lock files.
// Check that the lock files are still indented correctly, otherwise
// the change will cause problems with merging and the updateDeps script.

Expand Down
2 changes: 1 addition & 1 deletion build/skipBootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This can be used to write npm script like:
// node ./build/skipBootstrap.js || lerna bootstrap
// Which means "skip lerna bootstrap if SKIP_LERNA_BOOTSTRAP is set".
// This prevents suprious bootstraps in nested lerna repos.
// This prevents spurious bootstraps in nested lerna repos.

if (!process.env.SKIP_LERNA_BOOTSTRAP) {
process.exit(1);
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
![Pyright](img/PyrightLarge.png)

# Static type checker for Python

Pyright is a full-featured, standards-based static type checker for Python. It is designed for high performance and can be used with large Python source bases.

Pyright includes both a [command-line tool](command-line.md) and an [extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-pyright.pyright).


1 change: 1 addition & 0 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Github Site](https://github.com/Microsoft/pyright)
39 changes: 39 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- Getting Started

- [Installing Pyright](installation.md)
- [Getting Started](getting-started.md)
- [Static Typing](type-concepts.md)
- [Features](features.md)

- Customization

- [Configuration](configuration.md)
- [Configuration Options](configuration.md#main-configuration-options)
- [Diagnostic Rules](configuration.md#type-check-diagnostics-settings)
- [Execution Environments](configuration.md#execution-environment-options)
- [Sample pyrightconfig.json](configuration.md#sample-config-file)
- [Sample pyproject.toml](configuration.md#sample-pyprojecttoml-file)
- [Diagnostic Rule Defaults](configuration.md#diagnostic-rule-defaults)
- [Language Server Settings](settings.md)
- [Command Line Interface](command-line.md)
- [Controlling Behavior With Comments](comments.md)
- [Continuous Integration](ci-integration.md)

- Usage

- [Advanced Type Concepts](type-concepts-advanced.md)
- [Type Inference](type-inference.md)
- [Import Statements](import-statements.md)
- [Import Resolution](import-resolution.md)
- [Extending Builtins](builtins.md)
- [Type Stubs](type-stubs.md)
- [Types in Libraries](typed-libraries.md)
- [Differences from Mypy](mypy-comparison.md)
- [Commands](commands.md)

- Development

- [Building & Debugging](build-debug.md)
- [Pyright Internals](internals.md)


4 changes: 2 additions & 2 deletions docs/build-debug.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Building Pyright

To install the dependencies for all packages in the repo:
1. Install [nodejs](https://nodejs.org/en/) version 14.x
1. Install [nodejs](https://nodejs.org/en/) version 16.x
2. Open terminal window in main directory of cloned source
3. Execute `npm install` to install dependencies
3. Execute `npm run install:all` to install dependencies for projects and sub-projects


## Building the CLI
Expand Down
2 changes: 1 addition & 1 deletion docs/builtins.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Extending Builtins
## Extending Builtins

The Python interpreter implicitly adds a set of symbols that are available within every module even though they are not explicitly imported. These so-called “built in” symbols include commonly-used types and functions such as “list”, “dict”, “int”, “float”, “min”, and “len”.

Expand Down
Loading