github snok/flake8-type-checking v1.3.1

latest releases: v2.4.1, v2.4.0, v2.3.1...
2 years ago

The release of v1.3.0 was a bit premature. It contained the wrong defaults for a few settings, so we yanked the release.

These are the improvements and new features from v1.2.0:

Features

  • Added FastAPI support (#60)

    Added a --type-checking-fastapi-enabled option to treat decorated function annotations as required at runtime. Note that FastAPI also evaluates the annotations of callables passed to Depends. That is not handled by this setting.

  • Added a FastAPI-dependency-support setting (#66)

    For users that wish to prevent false positives at all costs, this setting treats all function definitions as required at runtime. The setting is available using --type-checking-fastapi-dependency-support-enabled

  • Added support for opting into class var checking, when pydantic support is enabled (#67)

    When pydantic support is enabled, checking of type annotation for classes is completely disabled if the class has at least one base class. This setting allows users to specify specific base classes to check additionally. For example, typing classes like NamedTuple, TypedDict, and Protocol seem like good candidates. Can be used with --type-checking-pydantic-enabled-baseclass-passlist.

Fixes and improvements

  • Corrected the flake8-extensions code in the project's pyproject.toml (was TCH rather than TC)
  • Removed dead changelog link in favour of releases link, in the pypi metadata
  • Removed pytest-cov in favour of just coverage
  • Rewrote sections of the docs

Don't miss a new flake8-type-checking release

NewReleases is sending notifications on new releases.