bpo-31072: Rename the new filter argument for zipapp.create_archive. (#3049)
bpo-31072: Rename the new filter argument for zipapp.create_archive (GH-3049)
* Rename the new argument to "filter"
* Improve tests for the new functionality
* Add a "What's New" entry.
diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst
index 993c2cc..120bbbb 100644
--- a/Doc/library/zipapp.rst
+++ b/Doc/library/zipapp.rst
@@ -99,7 +99,7 @@
.. function:: create_archive(source, target=None, interpreter=None, main=None,
- include_file=None)
+ filter=None)
Create an application archive from *source*. The source can be any
of the following:
@@ -144,9 +144,10 @@
contain a ``__main__.py`` file, as otherwise the resulting archive
would not be executable.
- The *include_file* argument specifies a callback function that is passed the
- relative path to the file in order to determine which files to store when
- being called against a directory.
+ The optional *filter* argument specifies a callback function that
+ is passed a Path object representing the path to the file being added
+ (relative to the source directory). It should return ``True`` if the
+ file is to be added.
If a file object is specified for *source* or *target*, it is the
caller's responsibility to close it after calling create_archive.
@@ -157,6 +158,9 @@
passed to the ``zipfile.ZipFile`` class, and must supply the methods
needed by that class.
+ .. versionadded:: 3.7
+ Added the *filter* argument.
+
.. function:: get_interpreter(archive)
Return the interpreter specified in the ``#!`` line at the start of the