Skip to content
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

Update dependency pyright to ^1.1.382 #2575

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 12, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
pyright (source) ^1.1.377 -> ^1.1.382 age adoption passing confidence

Release Notes

Microsoft/pyright (pyright)

v1.1.382: Published 1.1.382

Compare Source

Bug Fixes:

  • Fixed bug that can result in incorrect type evaluation behaviors if a call to type is used within a loop.
  • Fixed bug that results in incorrect type inference for list, set, dict, and tuple expressions that include modules in them.
  • Fixed bug that results in false positive error when using a Final variable in a protocol and a NamedTuple or frozen dataclass as a concrete class.
  • Fixed bug that results in a false negative when assigning a value to a union type that includes the same type variable multiple times in at least one invariant context. This change eliminates the concept of a "locked" constraint tracker, which is no longer needed and was the underlying cause of the bug.
  • Fixed bug that resulted in a "reportIncompatibleMethodOverride" error being reported in the wrong location when a property method has a decorator applied to it.
  • Fixed a bug that results in a false positive when assigning Never to a type variable in a contravariant context.
  • Added check for the illegal use of TypeForm as the second argument to an isinstance or issubclass call.
  • Fixed bug that results in incorrect type narrowing when a value typed as TypeForm is used as the first argument to isinstance.
  • Fixed a bug that can result in a false positive error when a function signature contains a positional-only parameter and a keyword parameter with the same name. This can result from the application of a ParamSpec or through the use of an unpacked TypedDict.
  • Fixed a bug that results in incorrect type evaluation behaviors when a class has a custom metaclass with a __call__ method and a __new__ or __init__ method that provides a different bidirectional type inference context for parameters.

Enhancements:

  • Added special-case handling for the len(t) == L type guard pattern to handle the negative narrowing case where tuple t has a minimum length of L. In this case, the narrowed type can be computed whereas previously it was left unnarrowed.
  • Improved hover text for converters in dataclass-like classes.
  • Updated typeshed stubs to the latest version.
  • Extended reportUnnecessaryComparison to cover more cases involving is and is not operators.

v1.1.381: Published 1.1.381

Compare Source

Bug Fixes:

  • Fixed bug that results in incorrect type narrowing for sequence patterns in the negative (fall-through) case when the subject is a tuple with an unbounded entry.
  • Fixed recent regression that results in a false positive error when attempting to assign the expression type(Any) to type type[Any].
  • Fixed a bug that results in incorrect evaluation of a variable in a doubly-nested loop that is assigned a value in an assignment expression.
  • Fixed a bug that results in incorrect narrowing of types for TypeIs user-defined type guard in certain cases when variable type is a union.
  • [Contribution by @​dcolascione] Fixed bug that results in a condition where imports stop resolving after file edits that change the set of modules that a file imports.
  • Fixed recent regression that results in incorrect type narrowing for isinstance in the negative case when using type as a filter.
  • Fixed bug that results in incorrect reporting of the Python version in a deprecation diagnostic message.
  • Fixed bug that results in incorrect code flow involving a call to a NoReturn callable with a function decorator applied.
  • Fixed bug that results in a spurious "symbol refers to itself" error under very specific conditions.
  • Fixed bug that can theoretically result in spurious errors when evaluating expressions that involve parameter symbols.
  • Fixed bug that results in incorrect type narrowing when TypeIs intersects type[A] with type[B]. Previously, pyright was producing <subclass of type[A] and type[B]> but now produces type[<subclass of A and B>].
  • [From pylance] Fixed recent regression that caused venvPath specified in language server settings to be ignored.
  • Fixed bug that results in a confusing error message extension referencing a missing __set__ method when assigning to a class variable that is not a descriptor object.
  • Fixed a bug that results in a false positive type error and confusing error message when assigning to a class variable that uses Self in its type definition.
  • Fixed a bug that results in spurious "variable not allowed in type expression" errors when a type alias is used in a loop in both a type expression and a value expression.

Behavior Changes:

  • Updated provisional support for TypeForm based on feedback to draft PEP 747.

Enhancements:

  • Expanded reportUnnecessaryIsinstance check to report cases where an isinstance or issubclass call always evaluates to False.
  • Improved error message for type violation in assignment statement where the LHS is an instance variable reference.
  • [From pylance] Update Unicode range tables to match Unicode 16.0, which is used for Python 3.14.

v1.1.380: Published 1.1.380

Compare Source

Bug Fixes:

  • Fixed a recent regression that results in incorrect type evaluation when using a two-argument form of super() and the second argument is type[Self].
  • Fixed a recent regression that results in a false positive type error when converting certain constructors (such as for the class defaultdict) to a callable type.
  • Fixed recent regression that results in a false positive under certain specific circumstances involving higher-order functions that return generic callable types.
  • Fixed a bug that results in a false positive error during protocol matching because writable class variables defined in a named tuple or a frozen dataclass were considered read-only.
  • Fixed a bug that causes incorrect type narrowing of expressions used within a tuple expression in the subject expression of a match statement.
  • Fixed a bug that results in an incorrect type evaluation of a higher-order function that is passed an overloaded function.
  • Fixed recent regression that results in a false positive error under very specific circumstances involving a function with a TypeVar used in both a contravariant and covariant context and combined by union with other types in the contravariant context.
  • Fixed a bug that leads to a false positive "default value is specified as ..." when using --verifytypes and the function has a decorator applied that uses a ParamSpec.
  • Simplified check for unnecessary isinstance call. Removed a bunch of redundant code and fixed a number of bugs in the process.
  • Fixed a bug that leads to incorrect type narrowing with isinstance or TypeIs when the filter type (the second argument to isinstance) is a subclass of type.
  • Fixed bug that results in incorrect type narrowing for the in (containment) operator when the filter includes class objects (instances of type).
  • Fixed a bug that results in incorrect type narrowing for the x is ... (ellipsis) type guard pattern.
  • Fixed a bug in the stub generator so it properly outputs type aliases that use the PEP 613 TypeAlias qualifier.
  • Fixed bug that causes a crash in the language server under certain circumstances with partially-written code that has syntax errors.
  • Fixed a bug that results in incorrect type narrowing for TypeIs when it is used with a Callable type form.
  • Fixed several inconsistencies and bugs in the isinstance type narrowing code involving callables

Enhancements:

  • Added performance optimization to better handle the case where a tuple expression contains thousands of entries. This is not typically found in hand-written code, but it can appear in computer-generated code.
  • Added support for custom metaclasses that derive from ABCMeta. Classes instantiated from such metaclasses are now treated as abstract.
  • Updated typeshed stubs to the latest version.

Behavior Changes:

  • Changed the behavior of the dictionary expansion operator (**) when used in an argument expression for a call and the operand is a TypedDict. It now takes into account the fact that a (non-closed) TypedDict can contain additional keys with object values. This new behavior is consistent with mypy.
  • Removed support for python-2 raise statements with comma-delimited operands.
  • Changed behavior of raise evaluation logic to allow type of exception to be Never.
  • Changed behavior to allow a value with type _AnnotatedAlias to be used with an implicit __getitem__ call even though this type is not documented or declared in typeshed.
  • Changed stub generator to avoid emitting a from __future__ import statement, which has no meaning in stub files.
  • Removed support for custom callable type guard pattern. Now that typeshed defines this with a TypeIs, we no longer require custom logic here.

v1.1.379: Published 1.1.379

Compare Source

Bug Fixes:

  • Fixed a bug that results in confusing hover information for an attrs field that uses a converter.
  • Fixed bug that results in incorrect type evaluation when assigning a recursive type alias to a tuple or list.
  • Fixed a bug that can result in difficult-to-reproduce type evaluation errors when modifying code in your editor and using pyright as a language server.
  • Fixed bug that results in the incorrect type when the Callable special form is used in a value expression.

Enhancements:

  • Added check for concatenated bytes and str literals.
  • Added provisional support for draft PEP 747 and the TypeForm special form.
  • Updated some diagnostic strings to refer to "type expression" rather than "type annotation" since they apply to some cases that don't involve annotations.

v1.1.378: Published 1.1.378

Compare Source

Bug Fixes:

  • Fixed bug that results in incorrect logging of the pythonVersion string.
  • (from Pylance) Fixed issue that resulted in the incorrect pythonVersion when a pyproject.toml is present with a "[tool.pyright]" section.
  • Fixed a bug that results in false negatives for errors in argument expressions used in a call to functools.partial in some cases. This same issue also causes symbols accessed in these arg expressions to not be marked as referenced.
  • Fixed bug that results in a crash in very specific circumstances that involve binding a method parameterized by a function-scoped ParamSpec.
  • Fixed a bug that resulted in incorrect evaluation when converting a constructor to a callable and the constructed class has a metaclass with a __call__ method whose cls parameter is annotated with type[T].
  • Fixed bug that results in a reportIncompatibleMethodOverride diagnostic being reported in the wrong location in some cases involving decorators.
  • Fixed a bug that results in a false negative when overloads overlap due to default values.

Behavior Changes:

  • Changed the default value of the disableBytesTypePromotions setting from false to true. It has been over two years since PEP 688 was accepted, so it's time for us to stop treating bytes as an alias for bytes | bytearray | memoryview. This is a breaking change and may require an update to the pyright configuration for some code bases.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the changelog:skip Don't include this pull request in the release change log label Sep 12, 2024
@github-actions github-actions bot added the dependencies Pull request that updates a dependency file label Sep 12, 2024
@renovate renovate bot force-pushed the renovate/pyright-1.x branch 2 times, most recently from fc979df to 989a587 Compare September 12, 2024 13:05
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.19%. Comparing base (635917f) to head (140f8c6).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2575      +/-   ##
==========================================
- Coverage   90.20%   90.19%   -0.01%     
==========================================
  Files         256      256              
  Lines       15690    15691       +1     
==========================================
  Hits        14153    14153              
- Misses       1537     1538       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renovate renovate bot force-pushed the renovate/pyright-1.x branch 6 times, most recently from 6faff36 to 85a0290 Compare September 12, 2024 19:20
@renovate renovate bot force-pushed the renovate/pyright-1.x branch 6 times, most recently from 560f900 to 56b2653 Compare September 16, 2024 15:06
@renovate renovate bot changed the title Update dependency pyright to ^1.1.380 Update dependency pyright to ^1.1.381 Sep 18, 2024
@renovate renovate bot force-pushed the renovate/pyright-1.x branch 3 times, most recently from 1e0c5c2 to dfa57d8 Compare September 18, 2024 18:57
@renovate renovate bot changed the title Update dependency pyright to ^1.1.381 Update dependency pyright to ^1.1.382 Sep 25, 2024
@renovate renovate bot force-pushed the renovate/pyright-1.x branch 3 times, most recently from 6992963 to 1a4e31c Compare September 26, 2024 16:46
Copy link
Contributor Author

renovate bot commented Sep 26, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:skip Don't include this pull request in the release change log dependencies Pull request that updates a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant