Skip to content

"--user" fixes #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 27 commits into from
Closed

"--user" fixes #511

wants to merge 27 commits into from

Conversation

qwcode
Copy link
Contributor

@qwcode qwcode commented Apr 16, 2012

Pull request to fix various "--user" issues

493: pip shouldn't allow --user installs in virtualenvs (w/o --system-site-packages)
440: pip install --user tries to uninstall system package
494: can't uninstall --user "develop" install
495: user site should be "local" in virtualenvs with --system-site-packages (mostly so we can test)

Tests are passing for py25, py26, py27, and py32 (against rebased branch from 4/15)

I'm happy to trim out or alter parts that may cause concern in the interest of getting as many of these issues resolved.

As mentioned to Carl over email, I'm concerned about the level of testing we can achieve for the "--user" feature, given that the test framework uses virtualenvs, and that full coverage would require real python installs.

I'd like to still add some mock/patch tests for the significantly altered util.egg_link_path, and more tests in general.

@@ -184,6 +185,8 @@ def run(self, options, args):
options.src_dir = os.path.abspath(options.src_dir)
install_options = options.install_options or []
if options.use_user_site:
if running_under_virtualenv() and virtualenv_no_global():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why check both here, since virtualenv_no_global implies running_under_virtualenv?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

early on in the commit history, "virtualenv_no_global" didn't imply "running_under_virtualenv". the former was just checking for the global file. later I changed "virtualenv_no_global", but didn't update these if statments.
I can change this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, even when "virtualenv_no_global" was only checking for the existence of a "no-global-site-packages.txt" in the right place, that's still pretty conclusive. not sure really why I ever had both checks in there : )

@carljm
Copy link
Contributor

carljm commented Apr 16, 2012

Thanks for working on this, generally looks great! More tests would be excellent, though I'd probably merge it with the current level of testing, pending comments above.

@qwcode
Copy link
Contributor Author

qwcode commented Apr 17, 2012

ok, cool, I'll post some updates in a day or two.

@qwcode
Copy link
Contributor Author

qwcode commented May 5, 2012

I think i've addressed everything that's been mentioned

questions:

  1. whether we should "fix" issue 495 (see comments in that issue). in this branch, it's "fixed"
  2. whether to use my new "path_in_dir" function or just to fall back to the old code

next weekend (when I have some more time) I plan on getting my environment straight once and for all, so I can pass all the tests.
currently, I always have some stragglers that fail. I'll feel more confident after that.

tests I've been running:
--linux: py24, py25, py26, py27, py32
--windows: py27

@@ -112,6 +113,14 @@ def fwrite(f, s):

from distutils.sysconfig import get_python_lib, get_python_version

def get_user_site():
"return site.USER_SITE or None if not implemented in earlier version of python"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit we should follow http://www.python.org/dev/peps/pep-0257/#one-line-docstrings and make it a sentence ie capitalize Return and end in a period.

@pnasrat
Copy link
Contributor

pnasrat commented May 13, 2012

lgtm - if you're happy with your testing

@qwcode
Copy link
Contributor Author

qwcode commented May 13, 2012

ok, I worked on my environments, and ran tests again for
linux: py24, py25, py26, py27, py32
windows: py27

for linux testing, down to 2 unrelated failures:

  1. 1 bz2 test failing for my non-py26 installs, due to it not being compiled in those py versions
  2. test_vcs_backends.test_git_with_tag_name_and_update fails across the board due to my git version having a different format for that kind of error

on windows:

  1. various failures related to my svn installation that I didn't take the time to sort out. I'm pretty out of touch with svn config on windows.
  2. a few failures because I don't have bzr installed

@pnasrat
Copy link
Contributor

pnasrat commented May 13, 2012

Github is complaining about mergability. I can try merge and thus cause a travis CI run on my personal develop branch, or maybe we can wait a little longer and get the test on pull request working see Issue #527

@qwcode
Copy link
Contributor Author

qwcode commented May 13, 2012

I'm willing to rebase my userscheme branch on my locally updated develop branch (and retest) and then force push userscheme to my origin. github shouldn't complain then about you merging userscheme, but I guess that would blow away all the comment references in this pull request. so probably not desired?

@pnasrat
Copy link
Contributor

pnasrat commented May 13, 2012

Are you on #pip on freenode? May be easier to discuss there.

@qwcode
Copy link
Contributor Author

qwcode commented May 14, 2012

ok, I think I did what we talked about on #pip
there's was just a minor conflict in util.py in the import lines.
tests still look good.

@qwcode
Copy link
Contributor Author

qwcode commented May 23, 2012

Carl/Paul:

I fear the scope of this branch has gotten too large for anyone to feel comfortable merging it.
I'm willing break this up into a series of smaller pull requests that build up to the same result.
The commit history in the smaller pulls would be much cleaner a 2nd time through, now that I've sorted thru all the issues.

let me know, if you think that would help?

@pnasrat
Copy link
Contributor

pnasrat commented May 23, 2012

If you feel willing and more comfortable doing that - that's fine with me.

However I'm probably happy enough to merge this shortly - I was hoping to fix #530 first so we have a good green build to depend on.

@qwcode
Copy link
Contributor Author

qwcode commented May 23, 2012

hmm...It's hard to decide. I know I'm more making more work for myself. : )
I'm inclined to be really conservative knowing pip is so widely used, and honestly I'm pretty new to contributing to a major project like this.
A series of smaller pulls with clear/concise commit histories would probably serve the history of the project better.
I have time this weekend, so I could start on it.

OTOH, if that sounds like more work for you, I understand.

@pnasrat
Copy link
Contributor

pnasrat commented May 23, 2012

That works for me, thanks for all your work on this! I'm travelling back home this weekend so I wouldn't expect responsiveness, but I'll try address next week.

@carljm
Copy link
Contributor

carljm commented May 23, 2012

I'm with Paul - I wouldn't have asked you to do that extra work, but I do find more smaller pull requests easier to deal with when possible.

@qwcode
Copy link
Contributor Author

qwcode commented May 29, 2012

here's my plan for breaking this up
https://gist.github.com/2822510

I'll reference the plan when I do requests.

@qwcode
Copy link
Contributor Author

qwcode commented Jul 8, 2012

closing, as this request is being handled in smaller parts:
https://gist.github.com/2822510

@qwcode qwcode closed this Jul 8, 2012
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants