You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/doko42'closed_at=<Date2010-03-16.01:27:28.931>created_at=<Date2010-03-14.19:41:31.667>labels= ['type-feature', 'library']
title='extend compileall to compile single files'updated_at=<Date2010-12-16.06:15:41.132>user='https://github.com/doko42'
when byte-compiling files in a deb/rpm package distributed e.g. in a Linux distribution, it is sometimes wanted to only touch the files found in the deb/rpm, which can be a subset of the files in a directory. the attached patch now lets compileall accept files as arguments as well and adds the recognition of @<filelist> and @- to expand the arguments with the contents of the file (@- meaning to read for stdin). Is this ok for 2.7, and a port of that to 3.2?
+1 on this functionality being added for 2.7 and 3.2. You also mentioned in pvt email that it would be better to patch compileall.py than py_compile.py to take advantage of the quiet and force options (which seems good to me).
I have a few comments on the diff:
It no longer applies cleanly to trunk. There was a recent commit that removed an unnecessary catch of KeyboardInterrupt, and I think that's what's causing the hunk reject.
I don't like @filename and @- as the syntax for reading the compilation list from a file. Since -f is already taken, what about adding -i<file> which tells it where to take the list from? Of course '-i -' would mean stdin.
Please add tests for the new functionality to test_compileall.py
Bonus points for updating this to modern Python <wink>. E.g. using True/False instead of 1/0, and 'OSError as error' instead of 'os.error, e'. But don't worry about that too much; I'll probably take that on as part of my PEP-3147 work. ;)
Activity
doko42 commentedon Mar 14, 2010
when byte-compiling files in a deb/rpm package distributed e.g. in a Linux distribution, it is sometimes wanted to only touch the files found in the deb/rpm, which can be a subset of the files in a directory. the attached patch now lets compileall accept files as arguments as well and adds the recognition of @<filelist> and @- to expand the arguments with the contents of the file (@- meaning to read for stdin). Is this ok for 2.7, and a port of that to 3.2?
warsaw commentedon Mar 15, 2010
+1 on this functionality being added for 2.7 and 3.2. You also mentioned in pvt email that it would be better to patch compileall.py than py_compile.py to take advantage of the quiet and force options (which seems good to me).
I have a few comments on the diff:
It no longer applies cleanly to trunk. There was a recent commit that removed an unnecessary catch of KeyboardInterrupt, and I think that's what's causing the hunk reject.
I don't like @filename and @- as the syntax for reading the compilation list from a file. Since -f is already taken, what about adding -i<file> which tells it where to take the list from? Of course '-i -' would mean stdin.
Please add tests for the new functionality to test_compileall.py
Bonus points for updating this to modern Python <wink>. E.g. using True/False instead of 1/0, and 'OSError as error' instead of 'os.error, e'. But don't worry about that too much; I'll probably take that on as part of my PEP-3147 work. ;)
doko42 commentedon Mar 15, 2010
changed the @ syntax to an option -i, and added a test for compile_file/compile_dir.
warsaw commentedon Mar 15, 2010
Looks good to me, and should help distros, so +1.
doko42 commentedon Mar 16, 2010
fixed for 2.7 and 3.2
merwok commentedon Dec 16, 2010
I have added versionadded directives that were missing in the doc.
merwok commentedon Dec 16, 2010
I also added the missing function description.