Commit Graph

7187 Commits

Author SHA1 Message Date
Rich Chiodo
ab402404b3
Drop support for node 12 (#7375)
* Drop support for node 12

* Forgot to update package-lock.json
2024-02-29 10:47:42 -07:00
Eric Traut
1f8fd8e2b0 Enabled PEP 705 and PEP 696 functionality without the use of enableExperimentalFeatures now that they are accepted. 2024-02-29 09:34:35 -07:00
Eric Traut
e19d1e7758 Fixed a couple of translation bugs for French. 2024-02-29 00:46:07 -07:00
Eric Traut
08397a0db3 Published 1.1.352 2024-02-28 16:59:21 -07:00
Eric Traut
3586183cd8 Updated closed TypedDict implementation to match latest thinking in typing forum. It is now generally agreed that a dict cannot be assigned to a closed TypedDict under any circumstance. https://discuss.python.org/t/pep-728-typeddict-with-typed-extra-items 2024-02-28 16:45:57 -07:00
Eric Traut
c81b09e595 Changed behavior of command-line "--pythonversion" and "--pythonplatform" options so they now override the same-named options in the config file. This addresses #7330. 2024-02-28 16:36:49 -07:00
Eric Traut
1c84fc0062
Fixed a bug that results in an incorrect "Unbound" type evaluation for a variable assigned within a loop. This addresses #7217. (#7361) 2024-02-28 00:45:13 -07:00
Eric Traut
495bd5b36f Fixed a bug that results in a false positive error when an await expression is passed as an argument to an overloaded function. This addresses #7222. 2024-02-28 00:22:46 -07:00
Eric Traut
8e184445e2
Fixed a bug in the import resolver that resulted in an incorrect resolution when an import within a __init__.py file uses the form from .a import a. This addresses #7233. (#7360) 2024-02-27 20:05:45 -07:00
Eric Traut
a8ee9f5554 Added missing check for inappropriate use of InitVar outside of a dataclass. 2024-02-27 18:52:11 -07:00
Eric Traut
afc6bca5ca
Refined the heuristic for when to use bidirectional type inference for the RHS of and and or operators. This addresses #7245. (#7348) 2024-02-26 14:25:05 -07:00
Eric Traut
e50cb1c315 Improved handling of enum.nonmember in cases where the attribute has a declared type. This addresses #7346. 2024-02-26 12:16:14 -07:00
Eric Traut
162d6c39ae
Fixed a bug that results in a false negative when passing an unpacked dict of the wrong type to a function that contains a positional-only parameter marker plus one or more keyword parameters. This addresses #7271. (#7341) 2024-02-25 20:14:09 -07:00
Eric Traut
b04f03d383
Fixed a bug that leads to a false positive type violation when reassigning a value within a loop and the target variable has a declared type of a constrained type variable. This addresses #7302. (#7340) 2024-02-25 19:48:01 -07:00
Eric Traut
a8bc2bdf59 Fixed style issue. 2024-02-25 19:04:18 -07:00
Lucian Wischik
c0fbb93ee4
Debugging (#7332)
* launch.json CLI debug that bypasses webpack

I got a bit irritated in my edit-build-debug inner loop with the time to run webpack.

This commit adds a new launch target called "Pyright CLI (pyright-internal)" which bypasses webpack and just runs the package straight from the packages/pyright-internal/out directory where tsc has built it.

* fix outFiles directive

The VSCode docs say about outFiles:
> By default, VS Code will search your entire workspace, excluding node_modules, for sourcemaps. In large workspaces, this search might be slow. You can configure the locations where VS Code will search for source maps by setting the outFiles attribute in your launch.json.

I guess this is the right change to make? it didn't make any difference in VSCode debugger's ability to hit breakpoints, though.

---------

Co-authored-by: Eric Traut <eric@traut.com>
2024-02-25 15:26:06 -07:00
Eric Traut
f7e37d51b9
Added support for call-site return type inference for class and instance methods. This addresses https://github.com/microsoft/pylance-release/issues/5515. (#7335) 2024-02-25 14:50:28 -07:00
Eric Traut
3232c25589 Added special-case handling for 'typing_extensions' module whose stubs are part of typeshed's stdlib stubs even though it is not part of stdlib. This addresses #7318. 2024-02-24 05:13:20 -07:00
Eric Traut
22b94ae3c3 Fixed a bug that leads to incorrect type inference for a lambda when passed to a constructor in certain circumstances. This addresses #7326. 2024-02-23 14:09:10 -07:00
Eric Traut
218ee2f82c Fixed a bug that resulted in "reportUnnecessaryTypeIgnoreComment" diagnostics to be generated even if the source file was in the "ignore" list. This addresses #7325. 2024-02-23 11:04:16 -07:00
Eric Traut
c8f1f082fc Added support for concatenated strings used in a @deprecated decorator. This addresses #7319. 2024-02-23 08:09:20 -07:00
Eric Traut
2b36897227 Fixed a bug that resulted in a false negative when attempting to use TypedDict or Protocol as an upper bound when using PEP 695 syntax. This addresses #7317. 2024-02-22 14:39:51 -07:00
Eric Traut
e67047551e Improved consistency of documentation when talking about diagnostic settings. 2024-02-21 15:39:13 -07:00
Eric Traut
512e29e70e Documented support for PEP 728. 2024-02-21 15:34:05 -07:00
Eric Traut
bcf694bd9c
Implemented provisional support for PEP 728 (support for extra items within TypedDicts). You must set enableExperimentalFeatures to true for now. This addresses #7232. (#7313) 2024-02-21 15:33:28 -07:00
dependabot[bot]
87171fbf96
Bump ip from 2.0.0 to 2.0.1 (#7304)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 12:11:31 -07:00
PylanceBot
e955fab18e
[PylanceBot] Pull Pylance with Pyright 1.1.351 (#7298)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-20 10:58:51 -08:00
Eric Traut
bc2544c996 Published 1.1.351 2024-02-19 15:25:09 -07:00
Eric Traut
6078f3deea Fixed build break. 2024-02-19 15:17:19 -07:00
Eric Traut
9265ebd4b0
Added check for the use of an implicit position-only parameter (one that starts with a double underscore) that is located after a non-position-only parameter. This addresses #7290. (#7297) 2024-02-19 15:13:25 -07:00
Eric Traut
9af0c64c88
Fixed a bug that led to incorrect type evaluation for a call that targets a generic function that uses a default argument for one of the generic parameters. This addresses #7291. (#7296) 2024-02-19 14:23:27 -07:00
Eric Traut
8cc8a75bf6 Fixed a bug that results in a false positive with the reportUnnecessaryCast check if the second argument is a special form. This addresses #7294. 2024-02-19 09:10:10 -07:00
Eric Traut
9e32b8fd57 Updated documentation to indicate support for PEP 742. 2024-02-19 01:17:00 -07:00
Eric Traut
08d3f6d38c Added provisional support for draft PEP 742 (TypeIs). 2024-02-19 01:03:55 -07:00
Eric Traut
1700e5451b Updated typeshed stubs to the latest version. 2024-02-19 00:36:06 -07:00
Eric Traut
d34a84c1d2 Fixed bug that results in a false positive error when calling update on a TypedDict with zero defined entries. This addresses #7289. 2024-02-18 13:48:29 -07:00
Eric Traut
caab6bdd02
Fixed bug that results in a false positive error when assigning a tuple value that includes an unpacked TypeVarTuple to another tuple that also includes an unpacked TypeVarTuple. This addresses #7285. (#7287) 2024-02-17 16:12:38 -07:00
Eric Traut
169443d5e5
Fixed a false positive reportUnknownArgumentType error when assigning an empty list or dict expression to an index expression subscripted with a slice. This addresses #7278. (#7286) 2024-02-17 15:15:11 -07:00
Eric Traut
ab2c824167 Changed behavior of CLI's --watch mode. Previously, it reported diagnostic deltas when it detected a change, but it is more useful if it reports all remaining diagnostics even for files that it didn't reanalyze due to a file change. This addresses #7267. 2024-02-17 14:46:36 -07:00
Eric Traut
853241c9b4 Added missing check for inappropriate use of an unpacked TypeVarTuple within a TypeAliasType type parameter list. This addresses #7284. 2024-02-17 13:41:15 -07:00
Eric Traut
effa6a24cb
Fixed a bug in the type narrowing logic for class pattern matching that resulted in incorrect narrowing in the negative (fall-through) case. This addresses #7280. (#7283) 2024-02-17 01:34:55 -07:00
Eric Traut
5d78e9eeba Change the heuristic for determining whether a metaclass supports __or__. In the case where the metaclass derives from Any or Unknown, pyright now assumes that it doesn't override __or__. This addresses #7260. 2024-02-15 17:49:04 -08:00
Eric Traut
fed85eca65
Fixed a bug that results in a false positive error when a enum.nonmember value is assigned to a class-scoped variable with a type annotation in an Enum class. This addresses #7265. (#7266) 2024-02-14 19:42:36 -08:00
Eric Traut
4b206e3068
Fixed a bug that results in a false positive error when a method defined within a named tuple is overridden by a subclass. This addresses #7256. (#7259) 2024-02-13 21:07:09 -08:00
Eric Traut
2ff6efb6d1
Fixed a recent regression that results in a false positive error when an Enum subclass overrides __new__ or __init__ and then a subclass of that class assigns tuple values when defining enum members. This addresses #7252. (#7253) 2024-02-13 01:02:59 -08:00
Eric Traut
6149e25c43
Fixed bug that results in a false positive "no overload implementation" error if an overloaded function is passed through a decorator that uses a ParamSpec. This addresses #7221. (#7246) 2024-02-12 00:39:52 -08:00
PylanceBot
b1bb82d8f1
[PylanceBot] Pull Pylance with Pyright 1.1.350 (#7240)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-09 13:35:42 -08:00
Erik De Bonte
ca64a6ceeb
Restrict vscode-pyright document selector to file and untitled schemes (#7231) 2024-02-08 15:41:21 -08:00
PylanceBot
e9f1cc51fe
[PylanceBot] Pull Pylance with Pyright 1.1.350 (#7219)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-06 16:38:59 -08:00
Lucian Wischik
3f6e47f719
Clarify that "exclude" overrides include directories *and* files (#7216)
The exclude directive overrides include directories *and* include files.

I verified by experiment, and also by reading the source code https://github.com/ljw1004/pyright/blob/main/packages/pyright-internal/src/common/uri/uriUtils.ts#L54
2024-02-06 12:02:57 -08:00