A plugin for flake8 that checks your code for imports that are only used in annotations. These imports can then be moved under an if typing.TYPE_CHECKING: block to prevent them being imported at runtime. This can minimise the number of runtime dependencies that your modules have and perhaps also reduce the likelyhood of a circular import.
For example:
import dataclasses
import datetime
@dataclasses.dataclass
class Person:
name: str
birthday: datetime.date
The above code will emit a lint (code: TCI100) telling you that it can be converted to this:
import dataclasses
import typing
if typing.TYPE_CHECKING:
import datetime
@dataclasses.dataclass
class Person:
name: str
birthday: datetime.date
You can install the latest version from pypi using pip like so:
pip install flake8-typechecking_import
Metadata
Release files for flake8_typechecking_import 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flake8_typechecking_import-0.5.tar.gz | 16.3 kB | Without provenance | Details for flake8_typechecking_import-0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_typechecking_import-0.5-py3-none-any.whl | Python 3 | none | any | Details for flake8_typechecking_import-0.5-py3-none-any.whl |
Total release size: 32.2 kB
Release files / flake8_typechecking_import-0.5.tar.gz
| Download URL | flake8_typechecking_import-0.5.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3f4e0804615b80563adce9768c81448adcc9c77cd20b2b779d6f28d23f42060
|
|
BLAKE2b-256 checksum How to use checksums |
945cc7c39d55547e0b152912ad0c5acb48996fc79399d37772ea1d4c09aa0df1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / flake8_typechecking_import-0.5-py3-none-any.whl
| Download URL | flake8_typechecking_import-0.5-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1194c64a9ebd1671ec2dcea6df07d7de12fff0b7371da76c885479cf2feaeb75
|
|
BLAKE2b-256 checksum How to use checksums |
58fb78164152d0090476cc46296e4d6d7cf45d768b8146e3dce44518a86701c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Security for flake8_typechecking_import 0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.