Add flag for check to check requirements.txt #13059
Labels
state: awaiting PR
Feature discussed, PR is needed
state: needs discussion
This needs some more discussion
type: feature request
Request for a new feature
What's the problem this feature will solve?
I want to see if the environment I'm in fully satisfies a given
requirements.txt
file.Describe the solution you'd like
Something like
pip check -r requirements.txt
(analogous to the existingpip install -r requirements.txt
).Alternative Solutions
There aren't a ton of workarounds.
There are a couple of ways to list all packages currently installed (either
pip freeze
orimportlib.metadata
), but they don't allow me to easily compare that list against arequirements.txt
file.Additional context
This came up for me while I was integrating some Python code with dependencies into a big C++ library that uses CMake. I want CMake to check if the current environment has all dependencies, and if so, use the current environment. Otherwise, it should create a venv and install dependencies from
requirements.txt
into that venv. This allows Python-aware devs to use their own environment, while C++-only devs don't have to think about it.However, I can imagine a lot of other use-cases where it would be useful to check if an environment contains all required dependencies for some project.
Code of Conduct
The text was updated successfully, but these errors were encountered: