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 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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to