Change filter_kwargs argument in create_archive
This commit is contained in:
parent
0ebf3f50fc
commit
35b38d90ad
|
@ -73,7 +73,8 @@ class ZipAppTest(unittest.TestCase):
|
|||
(source / 'test.pyc').touch()
|
||||
target = self.tmpdir / 'source.pyz'
|
||||
|
||||
zipapp.create_archive(source, target, filter=skip_pyc_files, suffix='.pyc')
|
||||
zipapp.create_archive(source, target, filter=skip_pyc_files,
|
||||
filter_kwargs={'suffix': '.pyc'})
|
||||
with zipfile.ZipFile(target, 'r') as z:
|
||||
self.assertIn('__main__.py', z.namelist())
|
||||
self.assertIn('test.py', z.namelist())
|
||||
|
|
|
@ -90,7 +90,7 @@ def default_filter(package, exclude=(), include=('*',)):
|
|||
|
||||
|
||||
def create_archive(source, target=None, interpreter=None, main=None,
|
||||
filter=None, compressed=False, **filter_kwargs):
|
||||
filter=None, compressed=False, filter_kwargs={}):
|
||||
"""Create an application archive from SOURCE.
|
||||
|
||||
The SOURCE can be the name of a directory, or a filename or a file-like
|
||||
|
@ -219,10 +219,11 @@ def main(args=None):
|
|||
if args.main:
|
||||
raise SystemExit("Cannot change the main function when copying")
|
||||
|
||||
filter_kwargs = {"include": args.include, "exclude": args.exclude}
|
||||
create_archive(args.source, args.output,
|
||||
interpreter=args.python, main=args.main,
|
||||
compressed=args.compress, filter=default_filter,
|
||||
include=args.include, exclude=args.exclude)
|
||||
filter_kwargs=filter_kwargs)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue