[14:10:28] <mitsuhiko> dstufft: why does pip prevent installation to --user in a non system package virtualenv without being able to override it?
[14:10:46] <mitsuhiko> i was trying to use it for plugin installation into a custom folder through PYTHONUSERHOME but it does not want to work (obviously)
[14:47:10] <mitsuhiko> but that's out of scope for me right now
[14:47:17] <mitsuhiko> but the plugin system is shaping up nicely
[14:47:31] <mitsuhiko> it's not competing with setuptools entrypoints but it's a bit more controlled for what i do
[14:49:26] <mitsuhiko> dstufft: i assume the uninstall action would never work for such things, right
[14:49:48] <dstufft> mitsuhiko: if you add the path to sys.path it'll find them
[14:49:57] <dstufft> but otherwise it won't know it's installed
[14:50:20] <mitsuhiko> i tried that, but that does not work
[14:50:30] <dstufft> hm, I thought it should, moment
[14:50:47] <mitsuhiko> dstufft: well, it finds it but it says that it's not in the venv and does not want to uninstall
[14:51:03] <mitsuhiko> and as far as i can see there is no way to override this
[14:51:08] <mitsuhiko> unless pip is not installed into a venv
[14:51:17] <mitsuhiko> (which is the same problem i had with --user)
[14:52:04] <dstufft> mitsuhiko: ah, that's probably running into code that prevents people from uninstalling stuff in the global site-packages
[14:52:29] <dstufft> probably that could be made smarter so it allows uninstalling stuff on PYTHONPATH
[14:52:44] <dstufft> or rather, so it only prevents the global site-packages
[14:52:49] <dstufft> and not other random dirs that someone might add
[14:53:23] <mitsuhiko> looking how much work changing that is
[14:54:12] <mitsuhiko> i could monkeypatch it easily :D
[14:54:34] <mitsuhiko> dstufft: actually, the right thing to fix would be a --add-managed-dir flag to uninstall
[14:54:40] <mitsuhiko> instead of using PYTHONPATH
[14:54:43] <mitsuhiko> or just --target like for install
[14:54:54] <dstufft> mitsuhiko: ah yea, not a bad idea either
[14:55:04] <mitsuhiko> would you accept such a patch?
[14:56:15] <dstufft> mitsuhiko: probably yes, modulo I haven't thought it through yet and i'm still trying to wake up :) but I can't think of any reason not to allow it atm
[14:56:37] <mitsuhiko> as far as i can see it could be self contained logic that is not triggered unless you pass --target
[15:00:40] <mitsuhiko> dstufft: how do you not get mad maintaining pip?
[15:01:01] <mitsuhiko> what looked like a 10 line change now looks like something that would require significant reengineering :-/
[15:02:13] <dstufft> mitsuhiko: I do sometimes, but someone needs to do it
[15:02:21] <dstufft> ah :( yea that happens, pip is poorly factored
[15:03:11] <dstufft> refactoring is on my TODO list, I started putting some stuff into place the last 2 weeks or so to start moving towards more unit tests and less functional tests to try and get tests covered better before that happens
[15:03:11] <mitsuhiko> it needs to go through PYTHONPATH because it uses pkg_resources
[15:03:25] <mitsuhiko> which funnily enough conflicts with how the rest of the code thinks uninstallation works
[15:05:55] <dstufft> I've started some movements to stop relying on pkg_resources too, though that's likely a longer term project
[16:06:33] <dstufft> mitsuhiko: hmm, is retaining the --target directory what should happen, or should pip install --target create the directory if it doesn't exist?
[16:26:15] <mitsuhiko> dstufft: not sure if pip install shuold create it
[16:26:19] <mitsuhiko> but i don't expect it to go away
[16:28:05] <dstufft> s/fail/hang forever after sys.exit is called/
[16:28:58] <mitsuhiko> dstufft: ah. i have a theory
[16:29:13] <dstufft> it happens here too https://github.com/pypa/pip/pull/1901/files
[16:30:07] <mitsuhiko> dstufft: sorry, can't find the right code. where do you invoke the subprocess?
[16:30:54] <mitsuhiko> dstufft: the reason it most likely hangs is because you did not read the buffer empty
[16:31:38] <dstufft> It fails here -> https://github.com/pypa/pip/blob/develop/tests/functional/test_install_config.py#L153, the subprocess calls is in another library, https://github.com/pypa/scripttest/blob/master/scripttest.py#L242-L260
[16:31:48] <dstufft> mitsuhiko: isn't .communicate() supposed to handle that?
[16:33:09] <mitsuhiko> dstufft: the problem is that communicate assumes the process actually ends if you fully read
[16:33:17] <mitsuhiko> if it ever gets only slightly interactive beyond that you hang
[16:33:27] <mitsuhiko> and because you can't signal into it you can't interrupt it
[16:34:32] <dstufft> not sure what you mean, pip does make it the whole way though it's own code, and calls sys.exit(), or do you mean something confuses subprocess into thinking the EOF never happens?
[16:36:20] <dstufft> oh, if i swap sys.exit(0) for os._exit(0) in the subprocess it works