[Python-Dev] Proposing PEP 376 (original) (raw)
P.J. Eby pje at telecommunity.com
Wed Apr 7 19:48:38 CEST 2010
- Previous message: [Python-Dev] Proposing PEP 376
- Next message: [Python-Dev] Episode 11 of A Little Bit of Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 11:33 AM 4/7/2010 -0500, Ian Bicking wrote:
On Wed, Apr 7, 2010 at 9:40 AM, Tarek Ziadé <<mailto:ziade.tarek at gmail.com>ziade.tarek at gmail.com> wrote: so for the PEP :
- sys.prefix -> the installation prefix provided by --prefix at installation time - site-packages -> the installation libdir, provided by --install-lib at installation time
How do you actually calculate site-packages? Â Would you store the directory name somewhere? Â Would you import the module and look at os.path.dirname(os.path.dirname(module.file))? Â Or just scan to see where the module would be? If you store the directory name somewhere then you have another absolute path. Â This is why, for simplicity, I thought it should be relative to the directory where the record file is (lots of extraneous ../, but the most obvious meaning of a relative filename).
The paths are relative to the sys.path entry for which the metadata applies - that's how you get to finding the .dist-info in the first place, so that's what you os.path.join to the paths in the record.
There's no "storing" of the directory name needed.
- Previous message: [Python-Dev] Proposing PEP 376
- Next message: [Python-Dev] Episode 11 of A Little Bit of Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]