3131from subprocess import run
3232import sys
3333
34- from commoncode .system import on_windows
35-
36- def generate_os_archive (links , requirement , archive_name ):
34+ def download_req_tools (links , requirement , dir_name ):
3735 """
38- Generate an archive as `archive_name.tar.gz` and `archive_name` directory
39- that contains wheels and sdist for specific OS and python by taking links,
40- requirement as an input.
36+ Download all dependencies into dir_name as per OS/arch/python by
37+ taking links,requirement as an input.
4138 """
4239 pip_args = [
4340 'pip' ,
4441 'download' ,
45- '--verbose' ,
4642 '--no-cache-dir' ,
4743 '--no-index' ,
4844 '--find-links' ,
4945 links ,
5046 '-r' ,
5147 requirement ,
5248 '--dest' ,
53- archive_name ,
49+ dir_name ,
5450 ]
5551 run (pip_args )
5652
5753
5854def main_with_args (args : str ) -> None :
5955 parser = argparse .ArgumentParser (
60- description = """Generate an archive as `archive_name.tar.gz` and `archive_name` directory
61- that contains wheels and sdist for specific OS and python .""" ,
56+ description = """Download all dependencies as per OS/arch/python by
57+ taking links,requirement as an input .""" ,
6258 )
6359
6460 parser .add_argument (
@@ -76,8 +72,8 @@ def main_with_args(args: str) -> None:
7672 )
7773
7874 parser .add_argument (
79- '--archive-name ' ,
80- help = 'Path to the archive file base name to create (without extension). ' ,
75+ '--dest ' ,
76+ help = 'Download packages into given directory(Destination) ' ,
8177 type = str ,
8278 required = True ,
8379 )
@@ -86,8 +82,8 @@ def main_with_args(args: str) -> None:
8682
8783 find_links = args .find_links
8884 requirement = args .requirement
89- archive_name = args .archive_name
90- generate_os_archive (find_links , requirement , archive_name )
85+ dest = args .dest
86+ download_req_tools (find_links , requirement , dest )
9187
9288
9389def main () -> None :
0 commit comments