Skip to main content

tool that checks that there are no __init__.py in your modules (or they are empty)

Project description

no_init

  • Tool that checks that there are no __init__.py in your modules.
  • It's opinionated tool, sometimes __init__.py files are useful. But often if you use them you end up in a circular import error mess.
  • Some packages (eg mypy) works better with __init__.py, for this case you can pass --allow-empty parameter.
# install
pip install no_init

# usage (you can also use python -m no_init)
no_init my_module

# require empty __init__.py for each all submodules (recursively)
no_init --require-empty my_module

# require __version__ variable in  my_module/__init__.py (no other content is allowed)
no_init --require-version my_module

pre-commit hook

</code></pre>
<h2>dev install</h2>
<pre lang="sh"><code>pip install -e .[dev]

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

no_init-0.2.0.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file no_init-0.2.0.tar.gz.

File metadata

  • Download URL: no_init-0.2.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for no_init-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a9d68b51c22a4adaae8aca589e12e5d5f56480bbc7b2588b896c81f87b343535
MD5 f91d2d3833125b8d5d768f6f200d39bd
BLAKE2b-256 142971daa3855854d984f299d14b8757db6020c04fb5dc6b57616c5a90be20c7

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