[02:47:52] ** cataska has joined us [02:48:11] ** cataska has left us [05:26:25] ** apoirier has joined us [06:09:39] [connected at Thu May 22 06:09:39 2008] [06:09:39] <> *** Looking up your hostname... [06:09:39] <> *** Checking ident [06:09:39] <> *** No identd (auth) response [06:09:39] <> *** Found your hostname [06:09:39] <> *** Your host is clarke.freenode.net[clarke.freenode.net/6667], running version hyperion-1.0.2b [06:09:41] [I have joined #peak] [06:09:41] ** clarke.freenode.net set the topic to does anyone remember the real topic ? - not really ... [10:15:20] ** apoirier has left IRC ("KVIrc 3.4.0 Virgo http://www.kvirc.net/") [10:53:55] zookofrpythoneer is now known as zooko [11:43:04] ** fengee has joined us [11:47:57] Let's see, if I find a file named (.*).egg-info, and then I take the first regexp group and call it "fname", then what do I need to do to fname in order to compare it to a setuptools Requirement .project_name? [11:48:03] Well, for starters I need to lowercase both of them. [11:48:07] What about spaces? [11:48:14] I'll check the setuptools docs, then the source. [11:49:19] Yay for setuptools docs! [11:49:27] "Tokens may be separated by whitespace, but any whitespace or nonstandard characters within a project name or version identifier must be replaced with -." [11:49:54] Hm, but what is a standard character? [11:56:22] Found it DISTRO = re.compile(r"\s*((\w|[-.])+)").match # Distribution or extra [11:56:38] ** pje has joined us [11:59:29] Hello pje. You might be interested in the IRC backlog. [11:59:57] So I guess I should just regex for files named ([\w.-]+).egg-info in the first place. [12:00:01] Then I need only to lowercase them. [12:11:50] * zooko tries to learn what a Requirement.unsafe_name is for. [12:14:36] Oh, I'll bet Distribution class already does all this for me. [12:17:21] No, Distribution class is a side-effecty thing which either wants the distribution to be actually present or else causes it to become present. [12:17:41] I just want to say "Support I had a distribution by the following name and version -- would it satisfy this Requirement?". [12:18:27] So far, I think in order to say that I need to actually lowreq = Requirement.parse(req.__str__().lower()) [12:18:32] Which isn't so bad. [12:20:59] Oh, I was confused -- Requirement.__contains__() doesn't take the name (for my use), just the version number. [12:21:24] So, while lowreq = Requirement.parse(req.__str__().lower()) still seems like a good idea, [12:21:41] I could also just say reqname = req.project_name.lower() and then use reqname in comparisons. [12:45:19] Distribution does not actually require something to be present. [12:46:10] If you want to find .egg-info distributions in a directory, you want find_distribution(dir, True) [12:46:44] er, find_distributions(dir, True), I mean [12:47:01] and 'dist in requirement' will tell you if it matches a requirement. [12:47:44] See for all the good stuff: http://peak.telecommunity.com/DevCenter/PkgResources#getting-or-creating-distributions [12:54:58] No, I'm starting with a list of strings, where each string is a filename. [12:54:59] But such a file is not present on my filesystem. [12:55:38] And I want to figure out -- assuming that those "foo-1.0-py2.5.egg-info" strings indicate the existence of real files somewhere out there in the world, would that Python package satisfy this requirement? [12:55:47] So I think the answer is simply lower() and Requirement.__contains__(). [12:55:50] Back later! [12:56:02] zooko is now known as zookonap [12:59:49] As I said, Distribution doesn't actually require the file to exist, unless you query things that can only be known from the file. [13:00:16] You probably should be using Distribution.from_filename(), unless of course you just *like* making things hard on yourself and duplicating functionality. :) [13:00:55] In fact, if you don't pass in a metadata object when you create the distribution, I think it can't access the filesystem at *all*. [13:01:38] Note that easy_install parses URLs and then creates distribution objects from them; it couldn't do this if there had to be a file. :) [13:20:58] zookonap is now known as zooko [13:21:33] Thanks! [13:21:39] I misunderstood about Distribution. [13:22:00] Perhaps because it said "Create a distribution by parsing a local filename.", which reminded me of [13:22:48] "An "environment" is a collection of Distribution objects, usually ones that are present and potentially importable on the current platform." to make me think that the Distribution class was only for locally-presdent hings. [13:24:13] Hm. Except that I doubt that it will accept the .egg-info file as the "filename" of the Distribution... [13:24:15] * zooko tries it. [13:25:06] Oh, it did. Cool. [13:26:10] Yay! [17:07:58] zooko is now known as zookoafk [17:34:00] zookoafk is now known as zooko [19:14:54] You might be interested in this conversation that is happening right now: [19:15:04] him: any gotchas? [19:15:10] me: I see that trac is built with setuptools. [19:15:10] That means that you can either use setuptools to install it into the system, [19:15:10] but GNU stow is cleaner, [19:15:11] but to use stow with setuptools you have to pass the following incantation: [19:15:13] ./setup.py install --single-version-externally-managed --record=somefilename.txt --prefix=/usr/local/stow/trac-0.11rc1 [19:15:17] him: and --record points to? [19:15:25] me: It's just a file that setuptools will write a list of which files it installed to where, within the prefix. [19:15:25] It's there because setuptools doesn't know about GNU stow, so it thinks if you are installing, you won't have any way to clean it out later without a list of all the files it installed. [19:15:28] Bascially it can be /dev/null. [19:17:28] zooko is now known as zookonap [19:35:38] zookonap is now known as zooko [20:29:25] ** pje has left IRC ("Client exiting")