For developing a script that runs pip install
it would be usefull to have a --dry-run
function.
I came across the --no-install
option. But this one is deprecated and on call references this.
There are hints to unpack a package only, but I can't find a unpack
option in the pip documentation.
With pip version 9 there's a new option
--format freeze
leading to an elegant one line solution for thepip install -r
use case:Yes - pip should have a
dry-run
option, to indicate what would happen in a complex situation. It is dangerous when runningpip install
downgrades packages without asking you. We need some way to ask what would happen if we runpip install -r requirements.txt
without laboriously searching thru all the requirements and comparing them to the currently installed ones.It looks like setup.py used to have a
dry-run
. Folks are asking for it elsewhere.Some progress in that direction can be found here:
It appears you are right, it has been deprecated (ref).
If by trial run you mean testing it out before actually installing a package in a certain place, presumably before a system wide install, then you can simply run it sandboxed using a virtual environment and then simply discard the environment.
Not as succinct as using a dry-run argument to pip, but it does the job. Also if you want to do a dry run of a series of package installations, omit the deletion at the end.
In a script you can distil it into a procedure:
If you want to do a dry run that tests that the new install(s) play well with system wide deployed, then use virtualenv's system-site-packages option.
[Ugly hack disclaimer] on Linux you can try to install in the system location as a user who does not have permission to install in the /usr/ directory. The command fails with "Permission denied" but only after logging what is missing and what is not.
(makes you wonder how hard an actual dry-run option would really be to implement)