PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Thursday the 11th of September, 2014

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[00:10:42] <_habnabit> crawln, you want to use get-pip with --user ?
[00:11:49] <_habnabit> crawln, wget ... | python - --user
[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
[01:26:07] <Pinchiukas> You mean get-pip.py?
[01:26:10] <agronholm> no
[01:26:14] <agronholm> the pip tarball
[01:26:58] <Pinchiukas> I'm not sure what you mean
[01:27:28] <agronholm> https://pypi.python.org/pypi/pip/1.5.6
[01:27:32] <agronholm> you see a tarball here, right?
[01:27:47] <agronholm> download it like you would any distribution
[01:27:50] <agronholm> extract
[01:27:58] <agronholm> and run python setup.py install
[01:27:59] <agronholm> done
[01:29:04] <Pinchiukas> Ah ok, thanks. :)
[01:29:20] <Pinchiukas> I was trying to install it with itself. :)
[01:34:24] <Pinchiukas> How do I do a user-local install with setup.py?
[01:39:16] <Pinchiukas> Found it!
[01:51:24] <Pinchiukas> My god... Not having root and wanting to use pip is hell...
[01:51:38] <Pinchiukas> And having no internet access too. :)
[02:10:06] <collinanderson> i subscribed to distutils-sig and send an email, and it's not showing up in the archives. did i do something wrong?
[12:15:53] <namsor_com> Hi! I've just installed Python, failed to install PIP to try and install 'hammock'. Any helping hand?
[12:23:24] <namsor_com> Ok found it's already installed. 'pip install something' needs be called in a regular command line, not in Python lang
[19:40:04] <agronholm> why does "pip install -d <dir>" never download wheels?
[19:41:46] <tomprince> It does here.
[19:41:49] <tomprince> What version of pip?
[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:07:52] <dstufft> er
[20:07:55] <dstufft> security not performance
[20:07:56] <dstufft> cannot brain
[20:08:56] <requiredfield> thanks dstufft
[20:09:34] <requiredfield> didn't realize requests[security] didn't work on py3. wish it hadn't let me install it then.
[20:10:57] <requiredfield> of course now i can't "pip uninstall requests[security]" since pip is borked
[20:11:51] <requiredfield> what is this ndg module?
[20:12:02] <requiredfield> https://pypi.python.org/pypi/ndg is comically bare
[20:12:03] <Alex_Gaynor> requiredfield: it's used for the improved ssl support in requests
[20:12:09] <Alex_Gaynor> requiredfield: yoru best bet is to just blow the the venv away and recreate it
[20:12:42] <requiredfield> oh man. Thanks Alex_Gaynor. I wonder if I can just hack site-packages/easy-install.pth?
[20:12:51] <requiredfield> it shouldn't be so easy to shoot yourself in the foot!
[20:12:58] <Alex_Gaynor> you might be able to just delete ndg out of site-packages
[20:13:00] <Alex_Gaynor> sounds hacky though
[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:15:58] <Alex_Gaynor> thanks
[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:31:36] <buck2> err released?
[20:31:43] <Alex_Gaynor> it's not out yet, it's close to a release though I think
[20:31:55] <buck2> i'll try out the prerelease and see
[20:32:22] <buck2> github develop branch yes?
[20:32:29] <Alex_Gaynor> yeah
[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:38:58] <dstufft> are you using wheels?
[20:39:03] <buck2> yes
[20:39:17] <DanielHolth> how long?
[20:39:18] <buck2> i haven't profiled quite yet, it's on my agenda for today
[20:39:22] <buck2> 5mins
[20:39:25] <DanielHolth> whoah
[20:39:32] <dstufft> how many things are you installing o.O
[20:39:47] <buck2> but i believe the time comes from pypi roundtrips
[20:40:01] <buck2> ... let me gather some numbers, that might be way wrong
[20:40:36] <dstufft> with pip 1.5.x there shoudl only be 3 HTTP requests per package assuming a completely empty cache
[20:40:55] <Alex_Gaynor> are you using --allow-external or anything like that?
[20:41:01] <buck2> no
[20:42:15] <buck2> dstufft: the scenario i'm working on is completely-full cache
[20:42:36] <buck2> we're on 1.5.5
[20:43:26] <dstufft> something sounds wrong, unless your on like the moon it shouldn't take 5 minutes if you're installing from wheels
[20:43:43] <buck2> it's 2 minutes
[20:43:59] <buck2> 283 packages
[20:44:30] <buck2> i'll show you the commands i'm using momentarily
[20:45:11] <Alex_Gaynor> ok, that's a lot of packages
[20:45:39] <Alex_Gaynor> 2 minutes / 283 packages => not very long per package
[20:45:58] <buck2> longer than i'd like is all
[20:46:15] <dstufft> oh
[20:46:17] <dstufft> 283 packages
[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)
[20:53:51] <dstufft> Alex_Gaynor: yea maybe
[20:54:02] <Alex_Gaynor> dstufft: like, maybe, but bring me data first :-)
[20:54:27] <dstufft> data is too hard, random guesses is easier!
[20:55:02] <dstufft> buck2: oh, that's 2 minutes for more than one pip op too
[20:55:16] <buck2> only the wheel one is long
[20:55:24] <buck2> i'll grab individual timings
[20:55:44] <dstufft> yea the wheel one is going to be long because it's going to be building wheels
[20:55:49] <dstufft> it's doing compiles and stuff
[20:56:46] <dstufft> buck2: is docutils included in this?
[20:57:04] <buck2> not sure what that means, but we don't build docs
[20:57:17] <buck2> dstufft: this is after all the wheels are built and cached
[20:57:20] <buck2> it's a long noop
[20:57:50] <buck2> my goal is to make it a quick noop
[21:00:30] <dstufft> buck2: i'd be interested to see what you have, I'm not familar with the wheel build code very well
[21:00:40] <buck2> have?
[21:01:01] <buck2> the build code isn't involved, everything is built and cached
[21:01:47] <dstufft> buck2: I mean what you have to make it faster, you said you were wanting to upstream something?
[21:02:00] <dstufft> (also you should try with the development branch, I wonder if it'd make it any faster)
[21:02:08] <buck2> ah nothing as yet, i wanted to agree on a rough plan first
[21:02:23] <buck2> i'm going to do that before i make any patch
[21:03:44] <buck2> (the dev branch)
[21:04:45] <buck2> i like to try to talk to upstream before i wind up walking down a very long dead end
[21:04:51] <dstufft> --download-cache is gone in the dev branch, there's an on by default cache now that operates at the HTTP request layer now
[21:05:01] <buck2> mkay
[21:05:08] <dstufft> so it'll cache files and the requests to the indexes too
[21:05:17] <dstufft> (assuming you have cache headers anyways)
[21:05:22] <buck2> might solve it, we'll see
[21:05:36] <buck2> dstufft: what's the recommended pypi server for internal use
[21:05:43] <buck2> ours doesn't seem well-maintained
[21:06:04] <dstufft> buck2: do you want to be able to upload with setup.py upload / twine/ some other CLI, or are you ok with scp
[21:06:16] <buck2> we're using git to version our stuff strictly
[21:06:29] <buck2> weird but meshes nice with our tools
[21:06:41] <buck2> so, no setup.py uploda or twine
[21:06:43] <dstufft> devpi is a software package that is pretty nice, it has some good stuff in it
[21:07:06] <dstufft> but all you _need_ is a bunch of stuff in a directory with nginx/apache/whatever and autoindex = on;
[21:07:13] <dstufft> stuff == files you want to install
[21:07:51] <buck2> i think ours is pretty close to apache autoindex
[21:16:39] <buck2> dstufft: now with individual timings http://paste.pound-python.org/show/NpxicBAM62PrsY1re38p/
[21:16:45] <buck2> 25s to unzip all the wheels, that's fine
[21:16:59] <buck2> but the 1:17 for pip wheel to do nothing is what i'd like to improve
[21:17:40] <buck2> trying develop branch now
[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:35:42] <buck2> untrue.
[21:36:01] <buck2> mm maybe my --find-links was to fix that
[21:36:09] <buck2> but i dont have that particular problem
[21:38:03] <buck2> where can i paste up an svg?
[21:38:21] <qwcode> buck2, yes, --find-links can work around the issue, but it is true that "pip wheel" rebuilds ignorantly
[21:38:40] <buck2> i was trying to remember why i had find-links there. i guess that's it.
[21:38:53] <qwcode> probably
[21:39:05] <buck2> i've verified that the wheels only build once per version
[21:39:12] <buck2> nicely cached
[21:48:44] <buck2> dstufft: this is profiling diagram of the problematic case https://gist.github.com/bukzor/48fffabea1484cf66ab0#file-slow-pip-png
[21:49:01] <buck2> i'm going to try to short-circuit it somehow, without affecting correctness
[21:50:07] <dstufft> buck2: question, do you have cache headers on your server?
[21:50:14] <buck2> how to check
[21:50:18] <buck2> curl -v ?
[21:50:23] <dstufft> yea curl will do it
[21:50:26] <dstufft> jsut curl one of the files
[21:51:07] <dstufft> you're looking for a Cache-Control or Expires header
[21:52:03] <_habnabit> curl -i is probably what you want fwiw
[21:52:22] <_habnabit> or curl --head
[21:52:52] <buck2> dstufft: http://paste.pound-python.org/show/kxZjq9qIJ2wVPAUgpLTq/
[21:53:13] <buck2> looks like no?
[21:53:38] <dstufft> yea no
[21:53:45] <dstufft> I dunno how to add headers to TwistedWeb
[21:54:16] <buck2> dstufft: do you think that will affect the behavior i'm looking at?
[21:54:28] <buck2> ie wheel won't go to the server if the headers say caching is ok
[21:54:33] <buck2> ?
[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
[21:58:30] <dstufft> s/packages/versions/
[21:58:38] <dstufft> so it knows what's available
[21:58:45] <buck2> dstufft: but not if i require ==
[21:58:49] <buck2> this was the case i wanted to add
[21:59:07] <_habnabit> wickman, https://github.com/pantsbuild/pex/issues/10
[21:59:37] <dstufft> buck2: should work
[21:59:57] <buck2> dstufft: the only case where that might be undesirable
[22:00:08] <buck2> is if someone "force pushes" the files on the pypi server
[22:00:24] <buck2> but that's not a case i personally care about
[22:00:24] <dstufft> sucks for them, force pushing is bad
[22:00:30] <buck2> ok, agree :)
[22:00:35] <dstufft> version numbers are free increment it
[22:00:37] <dstufft> imo
[22:00:40] <buck2> <3
[22:00:42] <buck2> go eat
[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:19:10] <wickman> habnabit: otherwise, pkg_resources.resource_stream etc
[22:20:34] <_habnabit> wickman, hmm
[22:20:45] <_habnabit> wickman, okay, thanks
[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:23:02] <wickman> that too ^
[22:23:03] <_habnabit> dstufft, also was considering that, haha
[22:23:14] <dstufft> that's what warehouse does
[22:23:16] <dstufft> it's pretty nice
[22:23:24] <dstufft> it also limits the stuff you have to configure
[22:23:37] <dstufft> no need to worry about setting up nginx or whatever to serve some directory
[22:23:45] <_habnabit> yeah
[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:46:54] <buck2> why the ceiling
[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:47:47] <buck2> ah true
[22:48:16] <buck2> oh ok i see that the packages are served under /packages/
[22:48:20] <buck2> derp
[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
[22:53:19] <buck2> exactly what i was hunting for
[23:03:06] <buck2> doesn't seem to make any difference
[23:03:16] <buck2> I added: < Cache-Control: public, max-age=604800
[23:04:26] <dstufft> buck2: this is linux/
[23:04:27] <dstufft> ?
[23:04:31] <buck2> yes.
[23:04:45] <dstufft> buck2: are there files in ~/.cache/pip/http/ ?
[23:04:58] <buck2> yep.
[23:05:19] <dstufft> is it still slower than download cache? or
[23:05:28] <buck2> just the same.
[23:05:32] <dstufft> ok
[23:05:43] <dstufft> so yea, probably the only way to get it down more is to implement the == thing then
[23:05:44] <buck2> implies just as many server round-trips
[23:05:54] <buck2> alrighty then
[23:07:01] <buck2> dstufft: would you give me a hint as to which file that if statement would go into?
[23:07:29] <buck2> pip.index.find_requirement?
[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:08:13] <dstufft> probably in pip/wheel.py
[23:08:15] <buck2> i'd be a list of what's cached that i'll need
[23:08:43] <dstufft> I think
[23:08:44] <dstufft> sec
[23:10:22] <dstufft> hrm
[23:10:32] <dstufft> this stuff is poorly factored :(
[23:10:41] <buck2> this method is 241 lines -.-
[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?
[23:12:37] <buck2> erm i guess in-the-wheelhouse
[23:12:43] <buck2> would be wheel.py
[23:13:05] <dstufft> yea
[23:13:21] <dstufft> this stuff is all really poorly factored and it jumps around
[23:13:35] <dstufft> so it might take a bit of digging to get it sorted out :/
[23:13:50] <buck2> i'll survive :)
[23:13:54] <buck2> not as bad as our code =X
[23:14:13] <buck2> thanks for hints