[06:14:46] [connected at Mon Jun 4 06:14:46 2007] [06:14:46] <> *** Looking up your hostname... [06:14:46] <> *** Checking ident [06:14:46] <> *** No identd (auth) response [06:14:47] <> *** Found your hostname [06:14:47] <> *** Your host is calvino.freenode.net[calvino.freenode.net/6667], running version hyperion-1.0.2b [06:14:49] [I have joined #peak] [06:57:54] ** aa_ has joined us [06:58:29] hi, the protocols reference online has latex elemnts in the code listings (if anyone cares) [08:02:15] ** zooko has joined us [12:04:11] ** pje has joined us [12:59:56] Good morning (Mountain Daylight Time), pje. [13:00:03] 'lo [14:07:33] So I'm working on using setuptools for packaging some stuff. [14:07:54] One of my goals is to have a single downloadable tarball that can then install everything off-line. [14:08:07] Just now cheeseshop was giving me 404's for setuptools. [14:08:12] This reminding me of why I value this. :-) [14:08:29] While I was typing that it coughed up setuptools 0.6c6 after a minute's delay... [14:09:17] interesting [14:10:05] But it still won't give me 0.6c1. [14:11:58] Whoa. Where did ez_setup.py get the setuptools-0.6c3 egg ? It didn't download it. [14:12:02] It must have found one lying around. [14:12:35] The stdout/stderr from "setup.py install" doesn't explain where it got that egg. Weird. [14:12:41] * zooko investigates. [14:19:32] Okay, it did find the egg sitting there in the CWD. Cool. [14:19:48] I remember you describing this to me before. It is a way that I can bundle setuptools as well as my dependent libs all into the same pacakge. [14:20:07] Oh, but I remember why I didn't do that -- I would have to include setuptools eggs for 2.3, 2.4 and 2.5, which is too much space usage for my taste. [14:20:30] I wonder if ez_setup.py will install setuptools from a src package instead of a bytecode package that it finds in the cwd... [14:21:36] no [14:21:38] it won't. [14:21:47] only easy_install can do that; ez_setup has to boot from an egg. [14:22:26] You'd have to write code to untar the source archive and run its setup.py [14:25:06] Thanks. [14:39:32] Again, it is taking something on the order of minutes to wget setuptools from cheeseshop. [14:39:33] * zooko sighs. [14:39:41] Maybe I'll bundle in the setuptools for py2.5... [14:44:10] download timed out/connection closed by cheeseshop web server. [14:44:14] * zooko tries again. [14:45:09] Did you know that dapper offers setuptools 0.6a9? [14:45:16] I wonder if that works with modern packages... [14:45:27] * pje shudders [14:45:34] That's like a year old, isn't it? [14:45:46] In case you don't know, dapper is Ubuntu's "Long Term Support" version. [14:46:05] So it might be useful (for my packages, at least) to support it, since it seems to be mildly popular on servers. [14:46:19] I think Ubuntu promised to provide security fixes for dapper for six years from its release. [14:47:00] Dapper is numbered 6.06, so it was released June, 2006. [14:48:22] Dammit. Failed again. Could you hook me up with a copy of setuptools-0.6c6-py2.5.egg ? [14:48:23] [14:50:58] bbiab [15:19:41] back [15:25:26] Hm. So there is something about my setup here that is breaking setuptools, even 0.6c6. [15:25:29] (Which I finally downloaded.) [15:25:36] I'm using the cmdline entry points feature. [15:25:55] And the executable, so launched, can't import its dependency, although the sys.path is right and I can import the dependency from the interactive interpreter. [15:27:54] http://pastebin.ca/537544 [15:32:04] Okay, now I added a line to the generated "zfec" easy-install-entry-script. [15:32:19] I told it to import argparse, print out the __file__ of argparse, then execute load_entry_point(). [15:32:35] That works, it prints out the __file__ of argparse, and then fails to import it when it executes load_entry_point: [15:32:41] http://pastebin.ca/537556 [15:39:16] I re-read the relevant parts of the setuptools doc but don't see any mention of this as a known bug or intended behavior. [15:54:26] By the way, I was thinking that if the easy-install.pth were a directory instead of a file (or if there were an optional adjunct easy-install.pth.d which were a directory) then GNU stow and setuptools might work together seamlessly. [15:57:58] Same result with setuptools-0.7a1dev_r55711 [16:05:06] Now I'm exploring what pkg_resources.py load_entry_point() is doing... [16:06:56] entry = __import__(self.module_name, globals(),globals(), ['__name__']) [16:06:56] [16:07:01] * zooko reads about the __import__() function. [16:07:30] I've already instrumented the code to print out sys.path just before this line (the call to __import__()), and sys.path includes [16:07:47] /usr/local/stow/python-2.5/lib/python2.5/site-packages/argparse-0.8.0-py2.5.egg [16:07:50] at that point... [16:08:37] It is the builtin __import__... [16:12:18] you say it "can't import" but you didn't say what the error message is [16:12:51] I put those in the pastebin. [16:13:09] http://pastebin.ca/537556 [16:13:19] So it *looks* like setuptools has a custom import hook which can understand eggs. [16:13:57] But that when my script is being executed by the entry-point hack script, and then it tries to import something, that it is using the standard builtin __import__, which fails to import argparse even though the .egg is on the sys.path, because the buildin __import__ doesn't know how to read eggs. [16:14:03] How am I doing? [16:14:56] .. on guessing what the problem is, I mean. [16:15:09] there is no custom import hook [16:15:15] Darn. I missed. [16:15:29] So how is the call to __import__ in pkg_resources supposed to successfully load a module from an egg? [16:15:46] where's the source code of cmdline_zfec.py? [16:16:11] http://allmydata.org/trac/tahoe/browser/src/zfec/zfec/cmdline_zfec.py [16:16:13] ^-- browsable [16:17:17] Ah. I guess that there is an *inner* import error that doesn't get caught. [16:17:38] So it isn't actually that setuptools import magic fails to import arg parse, it is that arg parse fails to import something else and raises an import error which gets misinterpreted. [16:17:49] Although it *does* say "argparse" in the error message, so maybe that's not it. [16:18:20] http://freshmeat.net/redir/zfec/69365/url_tgz/zfec-1.0.1.tar.gz#md5=86c0b6724dfed41fb02c3081b6021acf [16:18:22] ^-- downloadable [16:18:27] Here's your problem... it should be "from zfec.util import argparse" [16:18:40] Oh, sorry, that is the wrong source code. [16:19:00] What I'm doing here is changing that from copying argparse.py into zfec/util/, to instead relying on setuptools to install argparse as a package. [16:19:09] So the source code that I have *here*... [16:19:22] ok, so where is the source that imports argparse now? [16:20:39] argh. [16:20:41] So there's my problem. [16:20:47] It still says "from util import argparse" in there. [16:20:52] When it should say "import argparse". [16:21:26] Since the error message said "failed to import name argparse" I thought it was failing to import the global name "argparse" instead of failing to import "argparse" from "./util". :-( [16:21:28] Sorry to waste your time! [16:23:05] Thank you for your help. [18:01:42] pje: the code snippets in the pyprotocols reference manual online have bits of latex in them (in case you want to know) [18:18:15] ** bitmvnch has left IRC () [19:07:37] ah, probably latex2html on that box is borken :( [22:06:49] ** pje has left IRC ("Client exiting")