Package: ws.dependencychecker
This package provides adependencycheckerscript that checks whether an egg
declares all packages it imports in its setup.py.ContentsUsageEggs that contain several packagesKnown limitationsRelated packagesDevelopmentChangelogUsagedependencychecker [-h] [-v] [-z] package

Checks whether imported packages are declared in setup.py.

positional arguments:
  package        setuptools `requirement string`_,
                 e.g. ws.dependencychecker or ws.dependencychecker[test]

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  Print all lines importing missing packages
  -z, --zcml     Scan ZCML files
  -m , --mapping   Filename with additional egg-->packages mappingsSupported Python versions: 2.6, 2.7
(3.x is not supported because some dependencies are not ported yet, e.g.
zope.component).Althoughdependencycheckerdoes not import any files, it needs the package
and its dependencies to be on thePYTHONPATHso they are accessible viapkg_resources.working_set.By default,dependencycheckerprints a list of undeclared package names,
formatted ready for copy&paste into your setup.py’sinstall_requireslist,
like this:$ depcheck ws.dependencychecker
'gocept.testing.mock',If you want more details, use the verbose mode (pass-v):$ depcheck ws.dependencychecker -v
/home/wosc/depcheck/src/ws/dependencychecker/tests/test_check.py:4:import gocept.testing.mockTo use ws.dependencychecker within a buildout, use a snippet like this, for
example:[depcheck]
recipe = zc.recipe.egg
eggs =
    ${test:eggs}
    ws.dependencycheckerEggs that contain several packagesWith most eggs, the egg name and the provided package name is the same (e.g.
depending on thezope.interfaceegg will enable you to importzope.interface, but nothing else). Some eggs, however, contain more than
one package, and/or packages with different names (e.g. theZODB3egg
contains the packagesZODB,BTrees, andpersistent).ws.dependencycheckerhas a few heuristics built-in (ZODB, setuptools) to
deal with that, but when that’s not enough for your project, you can pass in a
mapping file of the following format:[egg_name]
package1
package2So in the ZODB example (which is actually built-in), that looks like:[ZODB3]
ZODB
BTrees
persistentYou don’t need to repeat the egg name itself, so in the case ofsetuptools(which also containspkg_resources), that looks like:[setuptools]
pkg_resourcesKnown limitationsOnly recognizes modules of the standard library for Python 2.7 at the moment.The built-in mappings for eggs that include several or differently named
packages are quite limited. Suggestions welcome!Does not recognize multiple packages imported on a single line
(import foo, barwill only pick upfoo),
but this spelling is frowned upon byPEP 8, anyway.Wrongly recognizes includes within multiline comments in ZCML.Does not support scanning zipped eggs.Related packagesimportcheckerfinds import statements that are not used in the code.DevelopmentThe source code is available in the mercurial repository athttp://code.wosc.de/hg/public/ws.dependencychecker.Please report any bugs you find toWolfgang Schnerring.Changelog1.1.1 (2011-12-15)Made compatible with Python-2.61.1 (2011-12-09)Consolidate package names into egg names
(e.g. zope.traversing.foo –> zope.traversing)Allow specifying additional egg–>package mappings.Support scanning of ZCML files.Change default output to grouped mode ready for copy&paste;
add verbose mode.1.0 (2011-12-06)first release.