Skip to main content

Package requirements checker, plugin for flake8

Project description

This module provides a plug-in for flake8, which checks/validates package import requirements. It reports missing and/or not used project direct dependencies.

This plug-in adds new flake8 warnings:

  • I900: Package is not listed as a requirement.

  • I901: Package is require but not used.

Important notice

In order to collect project’s dependencies, this checker evaluates Python code from the setup.py file stored in the project’s root directory. Code evaluation is done with the eval() function.

At this point it is very important to be aware of the consequences of the above approach. One might inject malicious code into the setup.py file, which will be executed by this checker. Hence, this checker shall NEVER be use to check code from an unknown source! However, in most cases, one validates code from a known source (e.g. own code) and one will run script stored in the setup.py file anyway. The worst case scenario is, that this checker will execute the equivalent of the python setup.py, which shall be idempotent (it’s a horribly designed setup.py file if it’s not).

If you have noticed some side effects during the flake8 check and your setup.py file is written in a standard way (e.g. pypa-sampleproject), please fill out a bug report.

Installation

You can install, upgrade, or uninstall flake8-requirements with these commands:

$ pip install flake8-requirements
$ pip install --upgrade flake8-requirements
$ pip uninstall flake8-requirements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_requirements-1.0.0-py2.py3-none-any.whl (10.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flake8_requirements-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_requirements-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 af8de10acf94e2feaceffa1ede0adc4b3800c8519737f4e3b145515f837749c4
MD5 67687bc5e3483b59f2d99245cd4c2419
BLAKE2b-256 bd6a226df7ad1b26e05e70328b9afdd7935d55f148a61161c66ff6851b82d44d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page