[00:12:32] <crawln> yeah i came up with the command after some trial and failure with the wget command using -O -
[00:12:46] <crawln> so it's all neat no extra files in the directory and no removing files
[00:12:54] <crawln> I have no clue why that was important but it was
[01:23:48] <Pinchiukas> Ok the installation of packages while offline is documented but how do I install pip itself offline? I don't have the ability to install system packages so --user is my only choice.
[01:24:14] <agronholm> Pinchiukas: download and run setup.py install
[20:03:15] <requiredfield> Hi #pip, I ran "pip install --upgrade requests[secuirty]" in a python3 virtualenv yesterday and it seems to have broken pip? now when i pip install something it fails with a SyntaxError because it's running code in .../site-packages/ndg/httpsclient/ssl_peer_verification.py with a python2-style "except ImportError, e"
[20:06:18] <requiredfield> hi dstufft et al., does ^^^ look familiar?
[20:07:13] <dstufft> I don't think requests[security] works on py3
[20:07:46] <dstufft> pip internally uses requests, and on py2 if you do requests[security] you'll get better performance
[20:13:54] <requiredfield> Alex_Gaynor: do you happen to know who maintains ndg / why they're keeping all this so secret? Trolling unsuspecting newbs? :)
[20:14:36] <requiredfield> (removing ndg seems to have unborked pip, yay)
[20:14:41] <Alex_Gaynor> requiredfield: https://pypi.python.org/pypi/ndg-httpsclient is teh module you're looking for FWIW
[20:14:52] <requiredfield> oh thanks, should have tried that
[20:15:21] <requiredfield> while i'm here thanks for the great work you've been doing to make python 2 more secure Alex_Gaynor
[20:29:54] <buck2> hello friends. I'm trying to optimize the pip portion of our build process today, and would like to make an effort to make sure any changes are up-streamable
[20:30:27] <buck2> our process has the packages completely cached (via --download-dir) and all requirements are pinned
[20:30:47] <buck2> my plan is to tell pip not to check with the pypi server for packages that are cached and pinned
[20:31:13] <Alex_Gaynor> buck2: I think you'll be interested in the caching stuff for pip 1.6, it basically does this AFAIK /cc dstufft
[20:31:31] <buck2> Alex_Gaynor: is 1.6 in a usable state?
[20:36:09] <DanielHolth> buck2 so you are using --no-index ?
[20:36:41] <DanielHolth> only having the correct versions available is a pretty effective form of pinning
[20:36:58] <buck2> our pypi server is the canonical source
[20:37:06] <buck2> the cache is only populated after grabbing from server
[20:38:42] <buck2> pinning isn't the issue per-se, it's that it takes a good long while to install everything even when everything is cached and pinned
[20:48:55] <Alex_Gaynor> dstufft: I wonder if it's time to think about a bulk API for PyPI?
[20:49:22] <dstufft> can we have an API that isn't "lets scrape some html" first
[20:50:34] <Alex_Gaynor> dstufft: oh, yeah, would be good
[20:51:14] <buck2> this is how our build process works http://paste.pound-python.org/show/Y4zp3ZdaumOt77t4sJgr/
[20:51:19] <dstufft> Alex_Gaynor: honestly the biggest problem with a bulk API is I don't think it'll win us much, since a bulk API would need the ability to say "give me the stuff for all these deps" it'd mean that for each unique installation combination we'd end up having a seperate cache item in Fastly
[20:51:36] <buck2> most of the time is under pip wheel and the "file was already downloaded" messages
[20:51:50] <Alex_Gaynor> dstufft: honestly, that doesn't sound too bad, there'll be lots of really common combos
[20:52:11] <Alex_Gaynor> without data I'm skeptical that it would lower the cache hit ratio
[20:52:20] <Alex_Gaynor> (well, lower it more than it helps)
[21:29:38] <buck2> verified same behavior in develop branch.
[21:29:50] <buck2> actually seems a bit worse: 1:59
[21:34:07] <qwcode> I haven't read this whole thread, but know that "pip wheel" currently rebuilds regardless if it exists in the --wheel-dir target https://github.com/pypa/pip/issues/855
[21:34:28] <buck2> untrue: Skipping zope.deprecation, due to already being wheel.
[21:35:27] <qwcode> that skips if the pypi download is a wheel, but if the download is an sdist, then from there it always rebuilds
[21:57:30] <dstufft> buck2: depends on what exactly it's requesting, the HTTP cache on pip will respect cache headers on *files* regardless of what it says (so a year or more is totally OK), but on the /simple/ pages it'll cache those for a max of 10 minutes
[21:57:45] <dstufft> (but if the cache expires it'll do a conditional GET instead of a full get if possible)
[21:58:07] <dstufft> buck2: so hre's the fundamental problem I think
[21:58:23] <dstufft> pip wheel <whatever>, needs to build up a list of all the available packages
[22:02:02] <_habnabit> wickman, also, i've been pondering about how to serve static assets out of a pex... the pex contains the whole website, including static assets, and i was trying to figure out how to make nginx serve those files without requiring pyramid to expend effort on static files
[22:18:28] <wickman> habnabit: one cheat is just 'unzip -d foo foo.pex && python foo' -- the files will be on disk and you can refer to them relative to __file__
[22:18:56] <wickman> habnabit: PEX_FORCE_LOCAL=1 ./foo.pex also does this but writes assets to .pex/cache/<hash> i think
[22:22:34] <wickman> habnabit: i've seen people w/ django apps just use pkg_resources to dump static assets to a tmpdir on disk and point the webserver there
[22:22:50] <_habnabit> wickman, that's what i was thinking about, actually
[22:22:53] <wickman> depends what your deployment looks like
[22:22:56] <dstufft> just serve it with python and stick a caching server in front of it
[22:24:43] <dstufft> (grnated it's a small problem in the grand scale of things, but hey it's a nice small thing)
[22:45:48] <buck2> dstufft: did you say that the cache headers for /simple don't affect anything?
[22:46:27] <dstufft> buck2: they effect whether it'll be cached or not, and for how long, the only thing is /simple/* stuff has a ceil of uh, 10 minutes I think on the cache
[22:46:42] <dstufft> and if your server supports conditional gets, we'll attempt to do that instead of a full GET
[22:46:50] <dstufft> assuming you give an ETag or something
[22:47:35] <dstufft> buck2: there was concern that people would end up accidently caching a /simple/ page for a long time, that isn't a big deal on a file (because files shouldn't change), but the /simple/ pages *do* change
[22:48:28] <dstufft> yea, it's not *actually* based on the URL structure
[22:48:36] <dstufft> it's based on where in the code pip makes the request from
[22:48:58] <dstufft> if it's when it's downloading a file, it has no ceil, if it's the discovery of files / looking for versions, there's a 10 minute ceil
[22:49:05] <dstufft> it's just easier to say /simple/ and /packages/
[22:49:13] <buck2> ok. so i'm going to hack this server to add some cache headers
[22:49:17] <buck2> and should expect some improvement
[22:50:54] <dstufft> if there's a valid cache response for whatever it won't hit the network at all
[22:51:01] <dstufft> if there's a stale response it'll do the conditional GET
[23:07:46] <dstufft> that's gonna be a tough one, most of that logic is in pip/index.py... but that explicitly checks for stuff that's isntalled, it doesn't take a list of things that are installed
[23:07:58] <dstufft> it'll either be in there or in pip/wheel.py
[23:10:44] <dstufft> https://github.com/pypa/pip/blob/develop/pip/wheel.py#L569 this is what triggers the download
[23:11:05] <buck2> dstufft: this is my critical path https://gist.github.com/bukzor/48fffabea1484cf66ab0#file-slow-pip-png
[23:11:24] <dstufft> self.requirement_set is an isntance of https://github.com/pypa/pip/blob/develop/pip/req/req_set.py#L53
[23:11:30] <dstufft> buck2: yea that thing I linked calls that
[23:11:46] <dstufft> I think it makes the most sense to try and remove things from the requirement set before that line if you already have a wheel for it
[23:12:20] <buck2> do i have a listing of what's cached?