Skip to main content

Trace module imports and detect/deny cyclic imports at runtime

Project description

Welcome!

import-watch allows to trace module imports and detect/deny cyclic imports at runtime with Python 2 and 3. It is licensed under the MIT license.

Enjoy!

Installation

# pip install import-watch

Usage

Trace imports

import import_watch
import_watch.trace_imports(depth=2)  # default depth is unlimited

Detect and warn about cyclic imports (at runtime)

import import_watch
import_watch.warn_about_cyclic_imports()

Deny cyclic imports (at runtime)

import import_watch
import_watch.deny_cyclic_imports()

Start fresh

import import_watch
[..]
import_watch.reset()

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

import-watch-2.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distributions

import_watch-2.0.1-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

import_watch-2.0.1-py2-none-any.whl (4.7 kB view hashes)

Uploaded Python 2

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