Giter VIP home page Giter VIP logo

z3c.dependencychecker's Introduction

z3c.dependencychecker

Checks which imports are done and compares them to what's in setup.py and warn when discovering missing or unneeded dependencies.

https://secure.travis-ci.org/reinout/z3c.dependencychecker.png?branch=master

z3c.dependencychecker reports on:

  • Unused imports: pyflakes is another tool that does this (and that also reports on missing variables inside the files).

  • Missing (test) requirements: imports without a corresponding requirement in the setup.py. There might be false alarms, but at least you've got a (hopefully short) list of items to check.

    Watch out for packages that have a different name than how they're imported. For instance a requirement on pydns which is used as import DNS in your code: pydns and DNS lead to separate "missing requirements: DNS" and "unneeded requirements: pydns" warnings.

  • Unneeded (test) requirements: requirements in your setup.py that aren't imported anywhere in your code. You might need them because not everything needs to be imported. It at least gives you a much smaller list to check by hand.

  • Requirements that should be test-only: if something is only imported in a test file, it shouldn't be in the generic defaults. So you get a separate list of requirements that should be moved from the regular to the test requirements.

It checks the following locations:

  • Python files for regular imports.
  • Zcml files for package="some.thing" attributes. It also supports Plone's generic setup files.
  • Python files, .txt and .rst files for imports in doctests.

The tests are quite sensitive to other python packages being available. If the tests do not run, first wrap the buildout in a virtualenv to make double sure there are no interfering packages. Or make sure you use a clean (system) python.

z3c.dependencychecker is a different application/packaging of zope's importchecker utility. It has been used in quite some projects, I grabbed a copy from lovely.recipe's checkout.

The source code can be found on github: https://github.com/reinout/z3c.dependencychecker

You can fork and fix it from there. And you can add issues and feature requests in the github issue tracker.

z3c.dependencychecker's People

Contributors

jone avatar reinout avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.