What's the problem this feature will solve?
Taking a long time to fail due to collection and downloading a package when pip install
is targeting a directory the user doesn't have permissions to write to.
Describe the solution you'd like
Before pip begins collecting a package, check if the user running pip has permission to write to the target directory.
I would be happy to write this feature as my first contribution to pip. New to python and curious if there's something naive about this enhancement proposal, I'll check out the code tonight.
Hello @tfolbrecht feel free to submit a PR :)
check_path_owner helper is likely to help.
Some considerations:
--prefix
, --root
, --user
, or the default (virtualenv or global).site-packages
directory that matters, so only checking that should be OK IMOThank you all so much for the help.
Diving through the pip internals in my freetime has been a lot of fun.
I'm steadily getting there.
Most helpful comment
Some considerations:
--prefix
,--root
,--user
, or the default (virtualenv or global).site-packages
directory that matters, so only checking that should be OK IMO