This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.moore
Recipients irmen, paul.moore
Date 2017-07-28.17:06:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501261589.15.0.913821735469.issue31072@psf.upfronthosting.co.za>
In-reply-to
Content
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 the archive. The function should return a boolean - False means don't include this file.

Because the create_archive function only gets a list of files internally (it uses Path.rglob()), the callable won't get passed directories, only the actual files (but it can of course check the full path to see what directory the file is in).

The include_file argument is ignored when copying anything other than a filesystem directory (i.e., when the source argument is a filename or an open file object).
History
Date User Action Args
2017-07-28 17:06:29paul.mooresetrecipients: + paul.moore, irmen
2017-07-28 17:06:29paul.mooresetmessageid: <1501261589.15.0.913821735469.issue31072@psf.upfronthosting.co.za>
2017-07-28 17:06:29paul.moorelinkissue31072 messages
2017-07-28 17:06:29paul.moorecreate