Hello, I'd like to make the RECORD file dead simple for PEP 376, and remove all the relocatable work we've started in it, since it'll go in a second file. This would be done in a second phase, with the work done at Pycon. So what I am proposing to keep in the PEP is this: =========================== The `RECORD` file is a CSV file, composed of records, one line per installed file. The ``csv`` module is used to read the file, with these options: - field delimiter : `,` - quoting char : `"`. - line terminator : ``os.linesep`` (so ``\r\n`` or ``\n``) Each record is composed of three elements. - the file's full **path**, as defined by the target system/ - the **MD5** hash of the file, encoded in hex. Notice that `pyc` and `pyo` generated files don't have any hash because they are automatically produced from `py` files. So checking the hash of the corresponding `py` file is enough to decide if the file and its associated `pyc` or `pyo` files have changed. - the file's size in bytes The ``csv`` module is used to generate this file, so the field separator is ",". Any "," characters found within a field is escaped automatically by ``csv``. When the file is read, the `U` option is used so the universal newline support (see PEP 278 [#pep278]_) is activated, avoiding any trouble reading a file produced on a platform that uses a different new line terminator. =========================== I think this is getting close to what Pip has today. Opinions ? Regards, Tarek -- Tarek Ziadé | http://ziade.org
On Mon, Mar 29, 2010 at 10:07 AM, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
Hello,
I'd like to make the RECORD file dead simple for PEP 376, and remove all the relocatable work we've started in it, since it'll go in a second file. This would be done in a second phase, with the work done at Pycon.
Ok, Iv'e done this, according to the feedback in the other thread: paths are now relative to sys.prefix, and absolute if not under sys.prefix. Anything else about PEP 376 before I propose it in python-dev ? :) Regards, Tarek -- Tarek Ziadé | http://ziade.org
On 2010-03-30, at 2:06 PM, Tarek Ziadé wrote:
On Mon, Mar 29, 2010 at 10:07 AM, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
Hello,
I'd like to make the RECORD file dead simple for PEP 376, and remove all the relocatable work we've started in it, since it'll go in a second file. This would be done in a second phase, with the work done at Pycon.
Ok, Iv'e done this, according to the feedback in the other thread:
paths are now relative to sys.prefix,
Ok.
and absolute if not under sys.prefix.
Sorry, I'm a little confused. So "/etc/myapp.conf" can be in RECORD? How would the second file (to be done in a second phase) be able to relocate this absolute path? -srid
On Wed, Mar 31, 2010 at 1:34 AM, Sridhar Ratnakumar <sridharr@activestate.com> wrote:
On 2010-03-30, at 2:06 PM, Tarek Ziadé wrote:
On Mon, Mar 29, 2010 at 10:07 AM, Tarek Ziadé <ziade.tarek@gmail.com> wrote:
Hello,
I'd like to make the RECORD file dead simple for PEP 376, and remove all the relocatable work we've started in it, since it'll go in a second file. This would be done in a second phase, with the work done at Pycon.
Ok, Iv'e done this, according to the feedback in the other thread:
paths are now relative to sys.prefix,
Ok.
and absolute if not under sys.prefix.
Sorry, I'm a little confused. So "/etc/myapp.conf" can be in RECORD? How would the second file (to be done in a second phase) be able to relocate this absolute path?
By having another file pretty similar to the sections we want to add in setup.cfg, in the dist-info directory, with expandable variables. Then re-created the RECORD file using the new relocation (see wiki.cfg for more details)
-srid
-- Tarek Ziadé | http://ziade.org
participants (2)
-
Sridhar Ratnakumar -
Tarek Ziadé