Skip to main content

Ensures your first-order deps are correct

Project description

checkdeps

It's really easy to accidentally use your transitive deps by accident. This project allows you to check (given a working venv) that everything you import actually comes from either relative imports, your explicit first-order deps, or stdlib.

Usage:

# Run within a working venv
# For CI
$ python -m checkdeps checkdeps

# If you use non-relative imports for your own project's code, also add
$ python -m checkdeps checkdeps --allow-names checkdeps

# For humans, pass -v
$ python -m checkdeps -v checkdeps/cli.py
checkdeps/cli.py:
  click available from ['click']
  pathlib.Path stdlib
  stdlibs.stdlib_module_names available from ['stdlibs']
  sys stdlib
  trailrunner available from ['trailrunner']
  typing.Dict stdlib
  typing.List stdlib
  typing.Optional stdlib
  typing.Set stdlib

Exits nonzero if there are any issues.

But aren't there projects that do this already?

I've looked at them, and I don't like the assumptions they make about top-level names, stdlib, or namespace packages. I think this project is more correct and more self-contained.

Future work

  • Read project metadata instead of requirements
  • Ensure metadata and requirements match
  • Offer to add missing deps
  • Better handling of version-dependent deps in an if or try/except

License

checkdeps is copyright Tim Hatch, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

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

checkdeps-0.0.2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

checkdeps-0.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file checkdeps-0.0.2.tar.gz.

File metadata

  • Download URL: checkdeps-0.0.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for checkdeps-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d1eff210a5b93db6a00e796ba87950ae8d726d731376113a7f3b9fca1c276150
MD5 010a02c3428583fbe5b3784c8148e62e
BLAKE2b-256 4a46483b8cc83b1845716cf6393a25f1947d3481d31eb3d5c8bf16d0d400754f

See more details on using hashes here.

Provenance

File details

Details for the file checkdeps-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: checkdeps-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for checkdeps-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e924e717da462ecb13ef901628c0de89bfe93f10351bfeb58fe0c7fa464e7cf
MD5 aa5f22804946e379b1837d901e790708
BLAKE2b-256 0319f68e17b291fd67b9c4642a62212b8dc0d775b06ff0c0f6104ac7883e6881

See more details on using hashes here.

Provenance

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