Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 6, 2024

This PR contains the following updates:

Package Change Age Confidence
mypy (changelog) ^0.971 -> ^1.0.0 age confidence

Release Notes

python/mypy (mypy)

v1.18.2

Compare Source

  • Fix crash on recursive alias (Ivan Levkivskyi, PR 19845)
  • Add additional guidance for stubtest errors when runtime is object.__init__ (Stephen Morton, PR 19733)
  • Fix handling of None values in f-string expressions in mypyc (BobTheBuidler, PR 19846)

v1.18.1

Compare Source

We’ve just uploaded mypy 1.18.1 to the Python Package Index (PyPI).
Mypy is a static type checker for Python. This release includes new features, performance
improvements and bug fixes. You can install it as follows:

python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs.

Mypy Performance Improvements

Mypy 1.18.1 includes numerous performance improvements, resulting in about 40% speedup
compared to 1.17 when type checking mypy itself. In extreme cases, the improvement
can be 10x or higher. The list below is an overview of the various mypy optimizations.
Many mypyc improvements (discussed in a separate section below) also improve performance.

Type caching optimizations have a small risk of causing regressions. When
reporting issues with unexpected inferred types, please also check if
--disable-expression-cache will work around the issue, as it turns off some of
these optimizations.

  • Improve self check performance by 1.8% (Jukka Lehtosalo, PR 19768, 19769, 19770)
  • Optimize fixed-format deserialization (Ivan Levkivskyi, PR 19765)
  • Use macros to optimize fixed-format deserialization (Ivan Levkivskyi, PR 19757)
  • Two additional micro‑optimizations (Ivan Levkivskyi, PR 19627)
  • Another set of micro‑optimizations (Ivan Levkivskyi, PR 19633)
  • Cache common types (Ivan Levkivskyi, PR 19621)
  • Skip more method bodies in third‑party libraries for speed (Ivan Levkivskyi, PR 19586)
  • Simplify the representation of callable types (Ivan Levkivskyi, PR 19580)
  • Add cache for types of some expressions (Ivan Levkivskyi, PR 19505)
  • Use cache for dictionary expressions (Ivan Levkivskyi, PR 19536)
  • Use cache for binary operations (Ivan Levkivskyi, PR 19523)
  • Cache types of type objects (Ivan Levkivskyi, PR 19514)
  • Avoid duplicate work when checking boolean operations (Ivan Levkivskyi, PR 19515)
  • Optimize generic inference passes (Ivan Levkivskyi, PR 19501)
  • Speed up the default plugin (Jukka Lehtosalo, PRs 19385 and 19462)
  • Remove nested imports from the default plugin (Ivan Levkivskyi, PR 19388)
  • Micro‑optimize type expansion (Jukka Lehtosalo, PR 19461)
  • Micro‑optimize type indirection (Jukka Lehtosalo, PR 19460)
  • Micro‑optimize the plugin framework (Jukka Lehtosalo, PR 19464)
  • Avoid temporary set creation in subtype checking (Jukka Lehtosalo, PR 19463)
  • Subtype checking micro‑optimization (Jukka Lehtosalo, PR 19384)
  • Return early where possible in subtype check (Stanislav Terliakov, PR 19400)
  • Deduplicate some types before joining (Stanislav Terliakov, PR 19409)
  • Speed up type checking by caching argument inference context (Jukka Lehtosalo, PR 19323)
  • Optimize binding method self argument type and deprecation checks (Ivan Levkivskyi, PR 19556)
  • Keep trivial instance types/aliases during expansion (Ivan Levkivskyi, PR 19543)
Fixed‑Format Cache (Experimental)

Mypy now supports a new cache format used for faster incremental builds. It makes
incremental builds up to twice as fast. The feature is experimental and
currently only supported when using a compiled version of mypy. Use --fixed-format-cache
to enable the new format, or fixed_format_cache = True in a configuration file.

We plan to enable this by default in a future mypy release, and we'll eventually
deprecate and remove support for the original JSON-based format.

Unlike the JSON-based cache format, the new binary format is currently
not easy to parse and inspect by mypy users. We are planning to provide a tool to
convert fixed-format cache files to JSON, but details of the output JSON may be
different from the current JSON format. If you rely on being able to inspect
mypy cache files, we recommend creating a GitHub issue and explaining your use
case, so that we can more likely provide support for it. (Using
MypyFile.read(binary_data) to inspect cache data may be sufficient to support
some use cases.)

This feature was contributed by Ivan Levkivskyi (PR 19668, 19735, 19750, 19681, 19752, 19815).

Flexible Variable Definitions: Update

Mypy 1.16.0 introduced --allow-redefinition-new, which allows redefining variables
with different types, and inferring union types for variables from multiple assignments.
The feature is now documented in the --help output, but the feature is still experimental.

We are planning to enable this by default in mypy 2.0, and we will also deprecate the
older --allow-redefinition flag. Since the new behavior differs significantly from
the older flag, we encourage users of --allow-redefinition to experiment with
--allow-redefinition-new and create a GitHub issue if the new functionality doesn't
support some important use cases.

This feature was contributed by Jukka Lehtosalo.

Inferred Type for Bare ClassVar

A ClassVar without an explicit type annotation now causes the type of the variable
to be inferred from the initializer:

from typing import ClassVar

class Item:

### Type of 'next_id' is now 'int' (it was 'Any')
    next_id: ClassVar = 1

    ...

This feature was contributed by Ivan Levkivskyi (PR 19573).

Disjoint Base Classes (@​disjoint_base, PEP 800)

Mypy now understands disjoint bases (PEP 800): it recognizes the @disjoint_base
decorator, and rejects class definitions that combine mutually incompatible base classes,
and takes advantage of the fact that such classes cannot exist in reachability and
narrowing logic.

This class definition will now generate an error:

v1.17.1

Compare Source

  • Retain None as constraints bottom if no bottoms were provided (Stanislav Terliakov, PR 19485)
  • Fix "ignored exception in hasattr" in dmypy (Stanislav Terliakov, PR 19428)
  • Prevent a crash when InitVar is redefined with a method in a subclass (Stanislav Terliakov, PR 19453)

v1.17.0

Compare Source

v1.16.1

Compare Source

v1.16.0

Compare Source

v1.15.0

Compare Source

v1.14.1

Compare Source

v1.14.0

Compare Source

v1.13.0

Compare Source

v1.12.1

Compare Source

  • Fix crash when showing partially analyzed type in error message (Ivan Levkivskyi, PR 17961)
  • Fix iteration over union (when self type is involved) (Shantanu, PR 17976)
  • Fix type object with type var default in union context (Jukka Lehtosalo, PR 17991)
  • Revert change to os.path stubs affecting use of os.PathLike[Any] (Shantanu, PR 17995)

v1.12.0

Compare Source

v1.11.2

Compare Source

  • Alternative fix for a union-like literal string (Ivan Levkivskyi, PR 17639)
  • Unwrap TypedDict item types before storing (Ivan Levkivskyi, PR 17640)

v1.11.1

Compare Source

  • Fix RawExpressionType.accept crash with --cache-fine-grained (Anders Kaseorg, PR 17588)
  • Fix PEP 604 isinstance caching (Shantanu, PR 17563)
  • Fix typing.TypeAliasType being undefined on python < 3.12 (Nikita Sobolev, PR 17558)
  • Fix types.GenericAlias lookup crash (Shantanu, PR 17543)

v1.11.0

Compare Source

v1.10.1

Compare Source

  • Fix error reporting on cached run after uninstallation of third party library (Shantanu, PR 17420)

v1.10.0

Compare Source

v1.9.0

Compare Source

v1.8.0

Compare Source

v1.7.1

Compare Source

v1.7.0

Compare Source

v1.6.1

Compare Source

v1.6.0

Compare Source

v1.5.1

Compare Source

v1.5.0

Compare Source

v1.4.1

Compare Source

v1.4.0

Compare Source

v1.3.0

Compare Source

v1.2.0

Compare Source

v1.1.1

Compare Source

Monday, 6 March 2023

We’ve just uploaded mypy 1.1.1 to the Python Package Index (PyPI). Mypy is a static type checker for Python. This release includes new features, performance improvements and bug fixes. You can install it as follows:

python3 -m pip install -U mypy

You can read the full documentation for this release on Read the Docs.

Support for `dataclass_transform``

This release adds full support for the dataclass_transform decorator defined in PEP 681. This allows decorators, base classes, and metaclasses that generate a __init__ method or other methods based on the properties of that class (similar to dataclasses) to have those methods recognized by mypy.

This was contributed by Wesley Collin Wright.

Dedicated Error Code for Method Assignments

Mypy can’t safely check all assignments to methods (a form of monkey patching), so mypy generates an error by default. To make it easier to ignore this error, mypy now uses the new error code method-assign for this. By disabling this error code in a file or globally, mypy will no longer complain about assignments to methods if the signatures are compatible.

Mypy also supports the old error code assignment for these assignments to prevent a backward compatibility break. More generally, we can use this mechanism in the future if we wish to split or rename another existing error code without causing backward compatibility issues.

This was contributed by Ivan Levkivskyi (PR 14570).

Fixes to Crashes
  • Fix a crash on walrus in comprehension at class scope (Ivan Levkivskyi, PR 14556)
  • Fix crash related to value-constrained TypeVar (Shantanu, PR 14642)
Fixes to Cache Corruption
  • Fix generic TypedDict/NamedTuple caching (Ivan Levkivskyi, PR 14675)
Mypyc Fixes and Improvements
  • Raise "non-trait base must be first..." error less frequently (Richard Si, PR 14468)
  • Generate faster code for bool comparisons and arithmetic (Jukka Lehtosalo, PR 14489)
  • Optimize __(a)enter__/__(a)exit__ for native classes (Jared Hance, PR 14530)
  • Detect if attribute definition conflicts with base class/trait (Jukka Lehtosalo, PR 14535)
  • Support __(r)divmod__ dunders (Richard Si, PR 14613)
  • Support __pow__, __rpow__, and __ipow__ dunders (Richard Si, PR 14616)
  • Fix crash on star unpacking to underscore (Ivan Levkivskyi, PR 14624)
  • Fix iterating over a union of dicts (Richard Si, PR 14713)
Fixes to Detecting Undefined Names (used-before-def)
  • Correctly handle walrus operator (Stas Ilinskiy, PR 14646)
  • Handle walrus declaration in match subject correctly (Stas Ilinskiy, PR 14665)
Stubgen Improvements

Stubgen is a tool for automatically generating draft stubs for libraries.

  • Allow aliases below the top level (Chad Dombrova, PR 14388)
  • Fix crash with PEP 604 union in type variable bound (Shantanu, PR 14557)
  • Preserve PEP 604 unions in generated .pyi files (hamdanal, PR 14601)
Stubtest Improvements

Stubtest is a tool for testing that stubs conform to the implementations.

  • Update message format so that it’s easier to go to error location (Avasam, PR 14437)
  • Handle name-mangling edge cases better (Alex Waygood, PR 14596)
Changes to Error Reporting and Messages
  • Add new TypedDict error code typeddict-unknown-key (JoaquimEsteves, PR 14225)
  • Give arguments a more reasonable location in error messages (Max Murin, PR 14562)
  • In error messages, quote just the module's name (Ilya Konstantinov, PR 14567)
  • Improve misleading message about Enum() (Rodrigo Silva, PR 14590)
  • Suggest importing from typing_extensions if definition is not in typing (Shantanu, PR 14591)
  • Consistently use type-abstract error code (Ivan Levkivskyi, PR 14619)
  • Consistently use literal-required error code for TypedDicts (Ivan Levkivskyi, PR 14621)
  • Adjust inconsistent dataclasses plugin error messages (Wesley Collin Wright, PR 14637)
  • Consolidate literal bool argument error messages (Wesley Collin Wright, PR 14693)
Other Fixes and Improvements
  • Check that type guards accept a positional argument (EXPLOSION, PR 14238)
  • Fix bug with in operator used with a union of Container and Iterable (Max Murin, PR 14384)
  • Support protocol inference for type[T] via metaclass (Ivan Levkivskyi, PR 14554)
  • Allow overlapping comparisons between bytes-like types (Shantanu, PR 14658)
  • Fix mypy daemon documentation link in README (Ivan Levkivskyi, PR 14644)
Typeshed Updates

Typeshed is now modular and distributed as separate PyPI packages for everything except the standard library stubs. Please see git log for full list of typeshed changes.

Acknowledgements

Thanks to all mypy contributors who contributed to this release:

  • Alex Waygood
  • Avasam
  • Chad Dombrova
  • dosisod
  • EXPLOSION
  • hamdanal
  • Ilya Konstantinov
  • Ivan Levkivskyi
  • Jared Hance
  • JoaquimEsteves
  • Jukka Lehtosalo
  • Marc Mueller
  • Max Murin
  • Michael Lee
  • Michael R. Crusoe
  • Richard Si
  • Rodrigo Silva
  • Shantanu
  • Stas Ilinskiy
  • Wesley Collin Wright
  • Yilei "Dolee" Yang
  • Yurii Karabas

We’d also like to thank our employer, Dropbox, for funding the mypy core team.

Posted by Max Murin

v1.0.1

Compare Source

v1.0.0

Compare Source

v0.991

Compare Source

v0.990

Compare Source

v0.982

Compare Source

v0.981

Compare Source


Configuration

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

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, 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.

Copy link
Contributor Author

renovate bot commented Aug 6, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: poetry.lock
Updating dependencies
Resolving dependencies...

The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Creating virtualenv bashplot-Unndpznn-py3.10 in /home/ubuntu/.cache/pypoetry/virtualenvs

The current project's supported Python range (>=3.6.2,<3.7) is not compatible with some of the required packages Python requirement:
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.7, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.8, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7
  - mypy requires Python >=3.9, so it will not be installable for Python >=3.6.2,<3.7

Because no versions of mypy match >1.0.0,<1.0.1 || >1.0.1,<1.1.1 || >1.1.1,<1.2.0 || >1.2.0,<1.3.0 || >1.3.0,<1.4.0 || >1.4.0,<1.4.1 || >1.4.1,<1.5.0 || >1.5.0,<1.5.1 || >1.5.1,<1.6.0 || >1.6.0,<1.6.1 || >1.6.1,<1.7.0 || >1.7.0,<1.7.1 || >1.7.1,<1.8.0 || >1.8.0,<1.9.0 || >1.9.0,<1.10.0 || >1.10.0,<1.10.1 || >1.10.1,<1.11.0 || >1.11.0,<1.11.1 || >1.11.1,<1.11.2 || >1.11.2,<1.12.0 || >1.12.0,<1.12.1 || >1.12.1,<1.13.0 || >1.13.0,<1.14.0 || >1.14.0,<1.14.1 || >1.14.1,<1.15.0 || >1.15.0,<1.16.0 || >1.16.0,<1.16.1 || >1.16.1,<1.17.0 || >1.17.0,<1.17.1 || >1.17.1,<1.18.1 || >1.18.1,<1.18.2 || >1.18.2,<2.0.0
 and mypy (1.0.0) requires Python >=3.7, mypy is forbidden.
And because mypy (1.0.1) requires Python >=3.7
 and mypy (1.1.1) requires Python >=3.7, mypy is forbidden.
And because mypy (1.2.0) requires Python >=3.7
 and mypy (1.3.0) requires Python >=3.7, mypy is forbidden.
And because mypy (1.4.0) requires Python >=3.7
 and mypy (1.4.1) requires Python >=3.7, mypy is forbidden.
And because mypy (1.5.0) requires Python >=3.8
 and mypy (1.5.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.6.0) requires Python >=3.8
 and mypy (1.6.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.7.0) requires Python >=3.8
 and mypy (1.7.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.8.0) requires Python >=3.8
 and mypy (1.9.0) requires Python >=3.8, mypy is forbidden.
And because mypy (1.10.0) requires Python >=3.8
 and mypy (1.10.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.11.0) requires Python >=3.8
 and mypy (1.11.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.11.2) requires Python >=3.8
 and mypy (1.12.0) requires Python >=3.8, mypy is forbidden.
And because mypy (1.12.1) requires Python >=3.8
 and mypy (1.13.0) requires Python >=3.8, mypy is forbidden.
And because mypy (1.14.0) requires Python >=3.8
 and mypy (1.14.1) requires Python >=3.8, mypy is forbidden.
And because mypy (1.15.0) requires Python >=3.9
 and mypy (1.16.0) requires Python >=3.9, mypy is forbidden.
And because mypy (1.16.1) requires Python >=3.9
 and mypy (1.17.0) requires Python >=3.9, mypy is forbidden.
And because mypy (1.17.1) requires Python >=3.9
 and mypy (1.18.1) requires Python >=3.9, mypy is forbidden.
So, because mypy (1.18.2) requires Python >=3.9
 and bashplot depends on mypy (^1.0.0), version solving failed.

  * Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties

    For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"
For mypy, a possible solution would be to set the `python` property to "<empty>"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers


Copy link

semanticdiff-com bot commented Aug 6, 2024

Review changes with  SemanticDiff

@renovate renovate bot force-pushed the renovate/mypy-1.x branch from 11a20e5 to dde86d5 Compare July 31, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants