--- id: flake8-requirements version: "2.3.0" license: unclear license_treatment: permissive maintenance: aging --- # flake8-requirements — Package requirements checker, plugin for flake8 License: permissive · Maintenance: aging · Downloads: 196.2K/mo ## What it is and what it does flake8-requirements is a flake8 plugin that checks whether the packages you import in your code are actually declared as dependencies in your project's configuration. It reports I900 warnings when you use a package that isn't listed in your requirements, helping catch missing dependency declarations before deployment. The plugin reads dependencies from setup.py (via eval), setup.cfg, pyproject.toml (PEP 621 or Poetry format), or requirements.txt. It includes a known mapping of package names to module names for common third-party packages, and allows custom mappings via flake8 configuration for private or renamed packages. A critical caveat: because it evaluates setup.py code to extract dependencies, you should only run it on projects you trust. Use it for: - Catch missing dependency declarations in CI/CD before publishing a package to PyPI. - Validate that all imports in a codebase are covered by declared requirements during code review. - Map custom or private package names to their module names so the checker recognizes them correctly. - Scan installed packages in the host environment to validate requirements against what's actually available. - Enforce dependency hygiene in monorepos or projects with complex, multi-level requirements files. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A flake8 plugin that validates whether imported packages are declared as project dependencies and reports missing or unused requirements. Yes, if you want automated validation that your code's imports match your declared dependencies. The low install friction and permissive license make it a straightforward addition to flake8 workflows. However, the aging maintenance status (last release 356 days ago) and the security caveat around eval() of setup.py mean you should only use it on trusted codebases and monitor the project for updates. ## Install pip install flake8-requirements uv add flake8-requirements poetry add flake8-requirements ## Installing flake8-requirements Before you install: Low friction install with three lightweight runtime dependencies (flake8, tomli, packaging). Maintenance status is aging—last release was 356 days ago, though the repository remains active with a recent commit on 2025-12-01. License in practice: Licensed under permissive terms (MIT), so you can use and modify freely in both open and closed projects. Quickstart: pip install flake8-requirements # Then run flake8 on your project: flake8 your_project/ # Or configure in setup.cfg: # [flake8] # known-modules = my-lib:[mylib.drm,mylib.encryption] Evaluates setup.py with eval() to extract dependencies—only use on code from trusted sources to avoid arbitrary code execution. Verify before relying: - Whether I901 (unused requirement detection) is actually implemented, as the description marks it 'not implemented yet' - Current state of support for modern Python versions beyond 3.8 and whether the aging maintenance status affects compatibility ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 196.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flake8 plugin dependency checker, validate package requirements, missing import requirements, flake8 import validation, check declared dependencies, unused package detection, requirement validation tool, flake8-plugin, dependency-validation, code-quality [View on SkillFed](https://skillfed.io/packages/flake8-requirements) · [View on PyPI](https://pypi.org/project/flake8-requirements/)