--user fixes part 4, issue #440 #574

Merged
merged 2 commits into from Jun 11, 2012

Conversation

Projects
None yet
3 participants
Contributor

qwcode commented Jun 11, 2012

this is part 4 of a breakup of pull request #511
full plan is here: https://gist.github.com/2822510
#440: pip install --user tries to uninstall system package

there are a few differences in how this was done in pull #511.
the most important difference deals with the tests correctly "simulating" a global-site/user-site conflict using virtualenvs. (see the comment in the last test added)

This pull request passes (merged 0aadda7 into 8d92fc2).

@pnasrat pnasrat commented on the diff Jun 11, 2012

pip/util.py
@@ -294,6 +294,14 @@ def dist_is_local(dist):
return is_local(dist_location(dist))
+def dist_in_usersite(dist):
+ """
+ Return True if given Distribution is installed in user site.
+ """
+ if user_site:
+ return normalize_path(dist_location(dist)).startswith(normalize_path(user_site))
+
@pnasrat

pnasrat Jun 11, 2012

Contributor

Maybe explicit return False for the case rather than implicit return.

Contributor

pnasrat commented Jun 11, 2012

Minor comment, thanks for breaking this out and adding thorough testing.

This pull request passes (merged 2b9e9b4 into 8d92fc2).

Contributor

pnasrat commented Jun 11, 2012

Thanks. Looks great. Will merge. See my note on the gist plan for adding a pull request to add news/authors.

pnasrat merged commit ae867db into pypa:develop Jun 11, 2012

Contributor

qwcode commented Jun 11, 2012

should I already be updating the news?, or can I assume all these parts will go in prior to the next release (assuming I keep working), and I can just add one news entry when I'm done that lists off all the --user fixes?

Contributor

pnasrat commented Jun 11, 2012

I was assuming you'd do it at the end for a complete summary. The commit breakdown is detail for the git changelog.

We probably need to release August time for python 3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment