[03:41:13] ** mike8 has joined us [06:12:25] [connected at Thu Feb 14 06:12:25 2008] [06:12:25] <> *** Looking up your hostname... [06:12:25] <> *** Checking ident [06:12:25] <> *** No identd (auth) response [06:12:25] <> *** Found your hostname [06:12:25] <> *** Your host is clarke.freenode.net[clarke.freenode.net/6667], running version hyperion-1.0.2b [06:12:27] [I have joined #peak] [06:12:27] ** clarke.freenode.net set the topic to does anyone remember the real topic ? - not really ... [06:42:42] ** apoirier has joined us [07:06:08] ** kilner has joined us [07:06:49] any setuptools/pkg_resources experts around? looking for advice on best practices [07:07:25] possibly [07:08:27] the question is, how do you refer to your current version number, author etc in things like usage text in your package when they are defined in your call to setup [07:09:17] for what prupose? [07:09:28] pkg_resources.working_set.by_key[...].version should work I guess, but it looks clumsy [07:09:36] do you mean this? [07:09:37] __version__ = __import__('pkg_resources').get_distribution('Trac').version [07:09:59] yes but won't that use the most recent version available on the system [07:10:09] yes [07:10:17] not necessarily what the current working version is [07:10:30] and also not necessarily the module you are part of [07:10:52] if another version had been loaded, the reasons for that should still be in effect [07:11:07] true [07:11:26] so get_dist will return what you expect [07:11:41] unless you bypass setuptools [07:11:56] but what if you have multiple versions installed on a system, and you've required an older version [07:12:20] won't get_dist return the newest version (and therefore it's usage string would be lying) [07:12:57] it shouldn't, as long as both are using the same WorkingSet [07:15:30] its all tracked internally [07:15:58] WorkingSet tracks active dists, and sys.modules tracks active modules [07:25:24] I suppose a future nice to have might be to have a __dist__ or something available in every module to have the distribution details (or just it's name maybe) available automatically [07:26:23] python doesn't do magic [07:26:51] its considered bad form [07:27:04] __name__, __module__ ? [07:28:14] are exposed by the core system [07:28:59] yes but as I said a nice-to-have.. if eggs and setuptools were to become part of the core [07:29:10] psl != core [07:29:28] for setuptools to do that it would have to alter a lot of namespaces, this gets very messy [07:31:50] fair enough [07:31:58] thanks for your help [07:32:24] oh but one more thing.... [07:33:23] __author__, __version__ etc, are there any guidelines on their usage when setuptools is in use [07:33:41] as in, should they just be ignored, or is it worth defining them still [07:34:24] __version__ is generally expected IME [07:38:07] __version__ = pkg_resources.get_distribution('Foo').version [07:43:47] importing pkg_resources from __init__ will mess up your namespace a bit, some people dislike that [07:45:21] ok, so how do you have it so that you only have the version specified once? [07:45:34] which is basically my original question [07:46:02] __version__ = __import__('pkg_resources').get_distribution('Trac').version [07:46:07] like I said before :) [07:46:39] ah sorry, missed that [07:46:44] thanks [08:49:25] ** jack-e has joined us [08:50:09] ** salfield has left IRC (Read error: 110 (Connection timed out)) [09:00:42] ** jack-e has left IRC () [10:16:18] hi back again with more questions along the same lines. Is there a way to access the author, url etc information you pass to setup in the Distribution object as you can the versio or should I be looking elsewhere? [12:08:20] ** mike8 has left IRC ("Leaving") [12:14:13] ** apoirier has left IRC ("KVIrc 3.2.6 Anomalies http://www.kvirc.net/") [13:00:46] ** pje has joined us [13:23:50] ** kilner has left us [17:59:18] ** pje has left IRC ("Client exiting")