Skip to content

Releases: snok/flake8-type-checking

v1.3.0

23 Jan 21:56
Compare
Choose a tag to compare

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. For now that is not handled by the setting.

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

v1.2.0

04 Jan 23:53
5549a5e
Compare
Choose a tag to compare

Features

  • Added Pydantic support (#58)

    For a quick summary of why Pydantic needs support in the first place: unlike most Python libraries, Pydantic evaluates annotations defined on their models at runtime. At the same time, this plugin is built on the assumption that imports which are only found in annotation slots, are not required at runtime. To make this work, we have added a --type-checking-pydantic-enabled option which, when toggled on, will treat all annotations from class variable annotations as required at runtime.

    This will lead to some false positives, e.g., for dataclass annotations, but in this case false positives are inconsequential and false negatives lead to runtime errors in prod, so better to favour the former in this case.

Fixes

  • Fixed end_lineno inference for __all__ assignments (#59)

v1.1.2

02 Jan 22:45
f886293
Compare
Choose a tag to compare

Fixes TC004 false positives for strings (#56)

v1.1.1

29 Nov 08:26
Compare
Choose a tag to compare

Fixes the logic for error code TC005 to prevent false positives (#53)

v1.1.0

18 Nov 07:26
2a465a9
Compare
Choose a tag to compare

Adds a new setting for ignoring TC001/TC002 errors for specific modules (#51).

v1.0.5

17 Nov 12:11
Compare
Choose a tag to compare

Updates error codes to comply with yesqa regex patterns (#50). Thanks @radoering 👏

v1.0.4

31 Oct 18:29
Compare
Choose a tag to compare
  • Updates package metadata and dependencies, making it clear that the package will only work on Python 3.8 and above.
  • Adds handling for the ast.Index node type on Python 3.8, fixing some false negative TC101 errors

v1.0.3

25 Jun 10:52
Compare
Choose a tag to compare
  • Now registers annotations in async function definitions correctly
  • Improved support for --enable-extensions and --extend-select

v1.0.2

04 May 11:11
Compare
Choose a tag to compare
  • Corrects fix in 1.0.1

v1.0.1

03 May 19:17
506337b
Compare
Choose a tag to compare
  • Fixes an error arising from running the package with flake8-bandit