Programmatically finding out which/if packages would be installed in a `pip install` run

Skip to first unread message

Feb 28, 2018, 12:15:01 PM2/28/18
to virtualenv
Hi list,
I am trying to determine what packages pip would install from within a Python script.

The use-case is this: I'm working on a special-purpose build system in Python, each project that it's used in has a requirements.txt and possibly constraints.txt with pinned versions of Python packages, everything gets installed to a checkout-specific venv. These files might change if the user switches branches, so I want to find out from within the build system if pip would install anything, so I can run `pip install` from within the build system and exit (so the user re-runs the build system with updated dependencies).

So I'm thinking of a dry-run from which I can infer if pip would install anything at all.
Reply all
Reply to author
0 new messages