pythonpiprequirements.txt

`requirements.txt` dependencies, getting only high level dependencies


I have a three python projects A, B and C. Each depending on each other.

How can I now "clean up" my requirements.txt that only the high level dependencies that are required at this "level" are there.

Example

A requirements:

boto3==1.2.4

B requirements:

A==0.0.1
boto3==1.2.4
cookiecutter==1.4.0

C requirements:

B==0.0.1
slacker==0.9.9
boto3==1.2.4
cookiecutter==1.4.0

The bold packages are the ones which should be filtered out.


Solution

  • pipdeptree can display the dependencies tree, and for a given package tell you which other package(s) depends on it.