Skip to main content

flake8 plugin which checks that a timeout is set to all requests and urllib.request.open calls

Project description

ci pre-commit.ci status codecov

flake8-timeout

flake8 plugin which checks that a timeout is set in all requests and urllib.request.open calls.

  • For example: requests.post('https://example.com') or urllib.request.open('https://example.com') will trigger TIM100
  • requests.post('https://example.com', timeout=5) or urllib.request.open('https://example.com', timeout=5) is expected instead

installation

pip install flake8-timeout

flake8 code

Code Description
TIM100 timeout missing for request call

as a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/pycqa/flake8
    rev: 4.0.1
    hooks:
    -   id: flake8
        additional_dependencies: [flake8-timeout==0.3.0]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_timeout-0.3.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

flake8_timeout-0.3.0-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flake8_timeout-0.3.0.tar.gz.

File metadata

  • Download URL: flake8_timeout-0.3.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for flake8_timeout-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d971d00a18884add1255490a24503fdf1a1b41165454cbd1bbf73cba7875e06b
MD5 a3936beb12806c4d75222e41b572da10
BLAKE2b-256 d056528c7c003927f7ba66fe17279e0b712899bed5c6722585d588ac7c7a0003

See more details on using hashes here.

File details

Details for the file flake8_timeout-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: flake8_timeout-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for flake8_timeout-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8d2783daef149d51ce6b3ad5eeb3a53ee2921cbcb076bde92ffbe88754401173
MD5 3868b13f4e3b8ebf0060a986daabad2d
BLAKE2b-256 716132113eb7efb2920391ff9421e64a0c91eeaeb03041b179b774f452beba00

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page