From a48f996d64312eff2cbde5a5d498ff21e51261d7 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Tue, 15 Mar 2022 07:59:04 +0100 Subject: [PATCH] forward python imports for checking with extract_release --- jupyter_releaser/cli.py | 17 +++++++++++++++-- jupyter_releaser/lib.py | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/jupyter_releaser/cli.py b/jupyter_releaser/cli.py index 6990f8d8..e273f47f 100644 --- a/jupyter_releaser/cli.py +++ b/jupyter_releaser/cli.py @@ -600,13 +600,26 @@ def delete_release(auth, release_url): @add_options(dry_run_options) @add_options(npm_install_options) @add_options(pydist_check_options) +@add_options(check_imports_options) @click.argument("release-url", nargs=1) def extract_release( - auth, dist_dir, dry_run, release_url, npm_install_options, pydist_check_cmd + auth, + dist_dir, + dry_run, + release_url, + npm_install_options, + pydist_check_cmd, + check_imports, ): """Download and verify assets from a draft GitHub release""" lib.extract_release( - auth, dist_dir, dry_run, release_url, npm_install_options, pydist_check_cmd + auth, + dist_dir, + dry_run, + release_url, + npm_install_options, + pydist_check_cmd, + check_imports, ) diff --git a/jupyter_releaser/lib.py b/jupyter_releaser/lib.py index dcdb964a..5ade62ce 100644 --- a/jupyter_releaser/lib.py +++ b/jupyter_releaser/lib.py @@ -292,7 +292,13 @@ def delete_release(auth, release_url): def extract_release( - auth, dist_dir, dry_run, release_url, npm_install_options, pydist_check_cmd + auth, + dist_dir, + dry_run, + release_url, + npm_install_options, + pydist_check_cmd, + python_imports, ): """Download and verify assets from a draft GitHub release""" match = parse_release_url(release_url) @@ -338,7 +344,11 @@ def extract_release( for asset in assets: suffix = Path(asset.name).suffix if suffix in [".gz", ".whl"]: - python.check_dist(dist / asset.name, check_cmd=pydist_check_cmd) + python.check_dist( + dist / asset.name, + check_cmd=pydist_check_cmd, + python_imports=python_imports, + ) elif suffix == ".tgz": pass # already handled else: