lony
lony

Reputation: 7750

`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.

Upvotes: 8

Views: 3457

Answers (2)

Denis Kot
Denis Kot

Reputation: 11

This works without grep: pipdeptree -f -d 0 -w silence

Upvotes: 1

bruno desthuilliers
bruno desthuilliers

Reputation: 77912

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

Upvotes: 10

Related Questions