[issue31072] add filter to zipapp

2017-08-26 Thread Paul Moore
Paul Moore added the comment: New changeset 0780bf7578dc4c9c3852dc5e869aba515a2c65b1 by Paul Moore in branch 'master': bpo-31072: Rename the new filter argument for zipapp.create_archive. (#3049) https://github.com/python/cpython/commit/0780bf7578dc4c9c3852dc5e869aba515a2c65b1 --

[issue31072] add filter to zipapp

2017-08-26 Thread Paul Moore
Paul Moore added the comment: OK. There's been no further comments, and I think the differences with PyZipFile's filterfunc are sufficient to warrant using a different name. I'm going to go with "filter". It's short, and says what it means. -- ___

[issue31072] add filter to zipapp

2017-08-11 Thread Paul Moore
Paul Moore added the comment: Sounds reasonable :-) I'm not going to be checking mails for a week or so, so I'll revisit this once I get back. -- ___ Python tracker

[issue31072] add filter to zipapp

2017-08-11 Thread Brett Cannon
Brett Cannon added the comment: What about simply 'filter' as a name? or 'path_filter'? -- nosy: +brett.cannon ___ Python tracker ___

[issue31072] add filter to zipapp

2017-08-11 Thread Paul Moore
Paul Moore added the comment: Zipapp uses path objects throughout, so making the filter function take a path object is consistent with that. I guess modifying PyZipFile to take either a string or a path object would be possible. As for the relative path, that's deliberate as I expect that a

[issue31072] add filter to zipapp

2017-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two differences between filterfunc arguments in zipapp and PyZipFile: 1. An argument of filterfunc is a string in PyZipFile and a Path object in zipapp. 2. The patch in zipapp is relative to the root of the archive. The patch in PyZipFile is a

[issue31072] add filter to zipapp

2017-08-09 Thread Paul Moore
Paul Moore added the comment: I've created a new PR 3049 adding the fixes you suggested (and tightening up the tests, as I noticed an untested aspect of the change while editing). -- ___ Python tracker

[issue31072] add filter to zipapp

2017-08-09 Thread Paul Moore
Changes by Paul Moore : -- pull_requests: +3084 ___ Python tracker ___ ___

[issue31072] add filter to zipapp

2017-08-09 Thread Paul Moore
Paul Moore added the comment: Good point - I wasn't even aware of the filterfunc argument in PyZipFile. I'll rename the argument. I wasn't initially sure about a what's new entry. I'll add one - and thanks for the reminder about versionadded. --

[issue31072] add filter to zipapp

2017-08-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Wouldn't be better to name the parameter filterfunc for conformity with PyZipFile? I think the new feature needs at least the versionadded directive in the module documentation. And may be an entry in the What's New document. -- nosy:

[issue31072] add filter to zipapp

2017-08-09 Thread Paul Moore
Paul Moore added the comment: Thanks to Jeffrey Rackauckas for the implementation of this feature. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue31072] add filter to zipapp

2017-08-09 Thread Paul Moore
Paul Moore added the comment: New changeset b811d664defed085d16951088afb579fb649c58d by Paul Moore (Jeffrey Rackauckas) in branch 'master': bpo-31072: Add filter to zipapp (#3021) https://github.com/python/cpython/commit/b811d664defed085d16951088afb579fb649c58d --

[issue31072] add filter to zipapp

2017-08-07 Thread Jeffrey Rackauckas
Changes by Jeffrey Rackauckas : -- pull_requests: +3054 ___ Python tracker ___ ___

[issue31072] add filter to zipapp

2017-07-28 Thread Paul Moore
Paul Moore added the comment: Yes, they can be. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue31072] add filter to zipapp

2017-07-28 Thread Irmen de Jong
Irmen de Jong added the comment: That sounds fine to me. I guess the paths passed to the function should be relative to the root folder being zipped? -- ___ Python tracker

[issue31072] add filter to zipapp

2017-07-28 Thread Paul Moore
Paul Moore added the comment: I'd propose an extra argument to zipapp.create_archive, include_file=None (feel free to bikeshed on the name). If the argument is not None, then it should be a callable which will be called with a pathlib.Path object for each file that's selected for inclusion in

[issue31072] add filter to zipapp

2017-07-28 Thread Irmen de Jong
New submission from Irmen de Jong: As briefly discussed on comp.lang.python, I propose to add an optional filter callback function to zipapp.create_archive. The function could perhaps work like the os.walk generator or maybe just lets you to return a simple boolean for every folder/file that