=== micahg_ is now known as micahg [02:21] wgrant: the setup_requires thing you mention in https://code.launchpad.net/~stub/launchpad/trivial/+merge/245822 - is that that zc.buildout just doesn't support it? [02:25] I've been experimenting with some upgrades lately, and seem to be going round in circles. ZTK 2.0a1 plus latest zc.buildout has trouble because site-packages isolation has gone away. Twisted >= 14.0.0 has trouble because it ideally wants new pyOpenSSL and that conflicts with a system package, but even if I ignore that, it hits https://github.com/testing-cabal/testtools/pull/149. Even once that or similar is merged, upgrading to ... [02:25] ... current testtools requires new pbr, which requires the swiftclient upgrade, and so we're back to buildout ... [02:26] And if we're ever to fix Twisted-based SSH servers to support OpenSSH 7.0 default config, we're going to have to upgrade Twisted at some point [02:28] Maybe we have to bite the bullet and convert to virtualenv and pip, perhaps with multiple virtualenvs so that we can have some of them configured with system site-packages which we seem to need [03:05] what site packages do you need ? [04:00] lifeless: python-debian, python-apt, IIRC [04:01] cjwatson: zc.buildout can't support it. [04:01] I believe I have a workaround for pbr, but I would have to look up my notes. [04:01] But basically setup_requires in its current implementation is the worst idea ever, unfortunately. [04:04] Worse than Zope 3? [04:04] Substantially. [04:04] Zope 3 is actually possible to use. [04:13] wgrant: whats the pbr problem ? [04:14] lifeless: setuptools has a PyPI fetish [04:14] "oh there's a setup_requires that isn't installed when you import setup.py? i guess i'll just go and download it from PyPI and install it for you that sounds like a good idea doesn't it" [04:15] If you can't convince buildout to install pbr first, setuptools will try to install pbr itself. [04:16] Firewalls (and good security practice) disagree with that. [04:20] you could write a recipe [04:20] like the one in the mock bug I was whinging about earlier [09:53] wgrant: https://pip.pypa.io/en/latest/reference/pip_install.html#controlling-setup-requires might be helpful, perhaps? [09:53] cjwatson: Yeah, .pydistutils.cfg works [09:53] It is rather unfortunate, however. [09:57] cjwatson: If we were using pip, though, we could just convince it to install pbr beforehand. [09:58] We don't have that option with setuptools, unless we like add a special eggs-setup config key to the recipes we use. [09:58] s/setuptools/buildout/ [09:59] We'd probably want .pydistutils.cfg anyway for robustness, but switching to pip is feeling increasingly like a good idea. [10:00] Not a trivial amount of work though. [10:01] It's easier if we can kill python-apt entirely :P [10:02] Are you sure that's the only one? [10:02] Also python-debian comes from eggs, not a system package [10:02] It's by no means the only one. [10:03] But it's the only really weird one I know of. [10:03] Well, other than tickcount. [10:04] It's kind of a zero or any thing. [10:05] wgrant: or add a recipe [10:05] It is. [10:05] But python-apt is the only really weird thing. [10:05] lifeless: Indeed, it's looking tempting to use a custom buildout or z3c.recipe.scripts in the short term. [10:06] Not z3c.recipe.scripts please, that doesn't work with buildout 2. [10:06] At least we need a way to migrate to something more like zc.recipe.egg [10:08] I think we may only need that for the weird stuff we do with site-packages, but I forget. [10:09] It's been a while since I've looked at buildout in depth. [10:09] Yes, I believe z3c.recipe.scripts is just for site-packages mangling [10:10] Does anything stop us from using virtualenv+pip once we no longer need site-packages mangling? [10:10] https://github.com/testing-cabal/mock/issues/310 may provide some inspiration for you [10:10] We use a consistent versions.cfg, so the isolation between txlongpoll etc. and LP is not critical. [10:11] Does anything stop us from using virtualenv+pip even while we do still need site-packages mangling? We could use multiple virtualenvs. [10:11] One with --system-site-packages and one without. [10:11] But we can't install the new Twisted in a system-site-packages virtualenv, can we? [10:11] So there's not much point, other than as an hour-long migration strategy. [10:13] I don't have an issue with it, I just don't see how it solves the problem. [10:14] We ... can't? http://paste.ubuntu.com/12123638/ [10:15] cjwatson: What was the pyOpenSSL issue? [10:15] "Twisted >= 14.0.0 has trouble because it ideally wants new pyOpenSSL and that conflicts with a system package" [10:15] lifeless: I can see how that would be helpful, though the fact that it would have to be based on z3c.recipe.scripts for buildout 1 and zc.recipe.egg for buildout 2 makes migration rather entertaining [10:17] wgrant: Stuff like http://paste.ubuntu.com/12123660/ which turns out to be because python-openssl 0.12-1ubuntu2.1 is installed [10:17] And indeed is a dep of launchpad-dependencies [10:18] The scripts stanza in buildout.cfg uses system site-packages. [10:18] Right. [10:18] So that's why we can't install the new Twisted in a system-site-packages virtualenv. [10:18] Or something. [10:18] Your motivation for moving away from system-site-packages was the pyOpenSSL issue. [10:18] I thought. [10:19] It doesn't work in a buildout 2 environment with no virtualenv at all, but it works fine in a system-site-packages virtualenv. [10:19] Ahh, I see. [10:20] Well, I need libffi-dev or something for it to actually install here, but at least pip seems to resolve things fine. [10:20] pyopenssl works fine in a pure virtualenv too [10:20] the pip cache can mitigate the compilation time [10:20] It would probably work with buildout 2 and appropriate virtualenvs, but I'm not sure doing it that way round is easier than just migrating to pip first [10:21] Yep, that might be reasonable. [10:21] I mean, that seems like strictly greater work. [10:22] At least if we plan to use pip eventually. [10:22] I was just confused as to why you provided the site-packages stuff as a motivation for not moving to zc.buildout 2.0, and then proposed switching to a system-site-packages virtualenv in its place. [10:22] Right, it's the lack of any virtualenv-like facility (even buildout 1's limited isolation support) in buildout 2 that causes the problem. [10:23] buildout 2 says to use virtualenv if you need that. [10:23] Well, it says to use virtualenv if you need isolation. [10:23] But you're suggesting using it even if we *don't* need isolation. [10:23] With evidence, which seems reasonable. [10:23] Oh, right, yes. [10:23] It just seemed totally insane without that critical piece of rationale. [10:24] Actually it must be a problem even in buildout 1, thinking about it. [10:24] Because my attempt to upgrade twisted didn't include my attempt to upgrade buildout. [10:24] I believe that we currently have pyOpenSSL in versions.cfg but do not actually rely on buildout to install it. [10:25] The problem comes as soon as something depends on a newer version. So we could alternatively backport a newer .deb, I suppose [10:26] Yeah, or we could just move to pip with system-site-packages since it seems to sidestep it. [10:26] exclude-site-packages is simply a sensible default; I doubt txlongpoll/txpkgupload actually require it. [10:26] So we can probably get away with one. [10:27] Fair point [10:29] So the next worry is how to cope with all the magic on praseodymium [10:29] I wonder if I have a copy of the relevant bits anywhere [10:30] Most of that magic is actually on carob [10:31] Recall that carob builds the tree, including all the eggs, then runs "make clean_buildout" [10:31] I'm not sure carob even builds the tree itself, since we used to have i386 machines. [10:31] Er. [10:31] Not sure *praseodymium* even builds the tree [10:32] IIRC everything uses make targets, except for the weird config-manager bits. [10:32] But they don't directly affect this. [10:32] carob does a "make build_eggs"; what deals with syncing the eggs directory around? [10:33] The eggs directory is a subdirectory of the tree. [10:33] Since that would presumably need to do the equivalent for a pip cache [10:33] So it just gets synced along with it. [10:33] (this is why make sync-stable sometimes fails hilariously; the tree build on carob is by no means atomic) [10:33] Oh, right, it's only a symlink in development setups [10:33] Oh [10:33] I forgot rf-setup did it that way. [10:33] I don't. [10:37] And AIUI our deployment-manager configs run "make compile" or equivalent on each target host, so in the new world order that would install stuff from the pip cache into an appropriate virtualenv. And we would need something site.py-like to cause our scripts to stick themselves into the right virtualenv. [10:38] I'd seriously consider building the virtualenv to go and then syncing it out rather than building on each host [10:38] The make targets I see that would now have silly names and need to have compatibility preserved at least for a transition period are build_eggs and clean_buildout [10:38] lifeless: Right, make compile could do nothing if it was there [10:39] lifeless: We could do that now, since the last i386 machines are dead [10:39] But that only happened a year ago :/ [10:39] Would it cause any problem in the case of heterogeneous Ubuntu releases? [10:39] Or Python versions? [10:40] Yeah [10:40] (Sure, everything's 2.7 now, but I don't want to put further roadblocks in the path of 3.x) [10:40] I guess our eggs dir is sort of like a wheel cache. [10:40] But I'm not sure wheels can be deployed for everything yet, can they? [10:40] so [10:40] wheels aren't perfect [10:41] but the cache and shipping it around is doable [10:41] however my point is more about deploy reliability [10:41] you're deploying to enough machines [10:41] I would be very happy to reduce the time taken by make compile during deployments, if nothing else. But I don't want to leave landmines in the process. [10:41] that its worth the complexity of a build+distribute mechanism rather than distributed builds [10:41] make compile is mostly slow because half our machines are piles of crap. [10:42] make compile on a fast machine is pretty quick. [10:42] as far as moving to new pythons goes [10:42] I'm not at all arguing against build+distribute, just trying to make sure I understand the issues. [10:42] virtualenvs are not particularly portable [10:42] even minor cpython builds can break them [10:43] Not all our deployment targets have the same paths, either. [10:43] so the requirement to do build+distribute is that for each target machine you have the same python locally [10:43] And the virtualenv docs caution against expecting path identity [10:43] and yeah, their paths are embedded in the virtualenv [10:44] but a container can address both things easily [10:45] This is really sounding like a later step that we should make sure we don't design ourselves out of, rather than something to do in the first run; where I came in was trying to cut Gordian knots [10:45] sure [10:46] I mean, not dodging the issue or anything, just trying to avoid having to change All The Things at once [10:46] I get it [10:46] I'm just surfacing options [10:46] Yeah [10:47] running pip on a prod server with --no-index -f should be reliable as long as you've neutered easy-install via .pydistutils.cfg [10:47] Yeah, I was hoping to avoid that. [10:47] no, you must neuter it [10:47] otherwise you'll be auditing forever [10:47] There was discussion a while ago about making pip pass options down so easy_install would be neatured [10:47] neutered [10:47] but I haven't seen whether that actually got done [10:47] there are no such options [10:48] and pip can't do it until we have declarative metadata for setup_requires used by *every package including old releases* [10:48] e.g. never [10:48] there is a route that might work [10:48] which is to make it error out with the missing dep [10:48] Right, easy_install had, or was going to grow, options for allow-hosts and find-links [10:48] and have pip parse the output [10:48] Which would be respected. [10:49] We can put the pydistutils.cfg in the virtualenv, I think? [10:49] Which seems a little easier to arrange than either system-wide or user-wide configuration [10:49] Oh, can we? [10:50] you can always export a custom HOME [10:50] Or even setup.cfg, according to the docs [10:50] https://docs.python.org/2/install/index.html#distutils-configuration-files [10:50] That seems too easy. [10:50] Or is that setup.cfg of the package being processed? [10:50] Huh [10:50] setup.cfg isn't accessible to you [10:50] because yes [10:50] Right, bah. [10:50] lib/python2.7/distutils/distutils.cfg might work [10:50] Maybe [10:50] But I doubt it. [10:50] Again, too easy. [10:52] virtualenv writes out a template file that claims it works. [10:52] http://paste.ubuntu.com/12123833/ [10:52] ! [10:54] Also /path/to/env/.pydistutils.cfg, according to the changelog for virtualenv 1.3.3 [10:55] Allegedly, though I'm not seeing that in the code. [11:04] Oh, yes I do, in the source. Couldn't find it in the installed virtualenv.py because it's helpfully zlib-compressed and base64-encoded. [11:05] I don't know why people also don't xor things with "Beware of the Leopard" while they're at it. [11:06] So env/.pydistutils.cfg seems by far the easiest [11:07] if it works, indeed that is amazing. [12:24] wgrant: http://paste.ubuntu.com/12124302/ actually a success for .pydistutils.cfg! [12:24] (that "succeeds" if I remove .pydistutils.cfg, so correctly blocked.) [12:25] Aha [12:25] Excellent. [12:25] I knew ~/.pydistutils.cfg worked, but if the virtualenv one works too then all the better. [12:26] Right, this is the virtualenv one. [12:45] OK, that can actually install everything - just needed a couple of wheel conversions and suchlike. The next steps are figuring out how to handle sitecustomize and buildout-templates. [12:45] cjwatson: Does "everything" include our dpkg deps? [12:46] wgrant: They're accessible from virtualenv/bin/python, if that's what you mean [12:47] Er of course [12:47] Sorry, neutron ate my brain. [12:47] I'm not sure I'm seeing this alleged wheel caching working. Maybe I need to install wheel first ... [12:47] What're you using wheels for here? [12:48] Nothing yet, but installing the world from sdist doesn't appear to be very quick. [12:48] Quite. [12:48] (Well, except for two packages that were previously installed from eggs.) [12:49] I grabbed pytz's wheel from PyPI, and ran 'wheel convert' for meliae. [12:49] I haven't actually investigated wheels in depth. [12:49] I didn't think they were totally a thing yet, but it seems they are. [12:55] http://paste.ubuntu.com/12124493/ is my output so far. [12:56] Very slow, but functionality is half the battle. [13:01] Yeah. Will shelve for a little while, don't want to accidentally spend the entire day on it [20:47] morning cjwatson, how was your trip? [20:50] blr_: Legoland++ [20:51] cjwatson: I've heard it is quite impressive :) === blr_ is now known as blr [20:53] wgrant: wheels are very much a thing :) [20:53] cjwatson: wgrant: I presume you both know about 'pip wheel' ? [20:55] Yes [21:23] oh right, wheel convert is a totally different thing [21:24] Yeah, things I did not want to spend any time on whatsoever included figuring out how to make a binary distribution of meliae and have it match the existing egg