skip to navigation
skip to content

Not Logged In

pip_missing_reqs 1.1.0

Find packages that should be in requirements for a project

Latest Version: 1.2.1

It happens: you start using a module in your project and it works and you don’t realise that it’s only being included in your virtualenv because it’s a dependency of a package you’re using. This tool finds those modules so you can include them in the requirements.txt for the project.

Assuming your project follows a layout like the suggested sample project:

setup.py
setup.cfg
requirements.txt
sample/__init__.py
sample/sample.py
sample/tests/test_sample.py

Basic usage, running in your project directory:

<activate virtualenv for your project>
pip-missing-reqs --ignore-files=sample/tests/* sample

This will find all imports in the code in “sample” and check that the packages those modules belong to are in the requirements.txt file.

Sample tox.ini configuration

To make your life easier, copy something like this into your tox.ini:

[pip-missing-reqs]
deps=-rrequirements.txt
commands=pip-missing-reqs --ignore-files=sample/tests/* sample

Excluding test files (or others) from this check

Your test files will sometimes be present in the same directory as your application source (“sample” in the above examples). The requirements for those tests generally should not be in the requirements.txt file, and you don’t want this tool to generate false hits for those.

You may exclude those test files from your check using the –ignore-files option.

Excluding modules from the check

If your project has modules which are conditionally imported, or requirements which are conditionally included, you may exclude certain modules from the check by name (or glob pattern) using –ignore-mods:

# ignore the module spam
pip-missing-reqs --ignore-mods=spam sample
# ignore the whole package spam as well
pip-missing-reqs --ignore-mods=spam --ignore-mods=spam.* sample
 
File Type Py Version Uploaded on Size
pip_missing_reqs-1.1.0-py2.py3-none-any.whl (md5, pgp) Python Wheel 2.7 2014-07-18 19KB
pip_missing_reqs-1.1.0.tar.gz (md5, pgp) Source 2014-07-18 6KB
  • Downloads (All Versions):
  • 211 downloads in the last day
  • 1307 downloads in the last week
  • 5700 downloads in the last month