Skip to content

Commit d0e1386

Browse files
Improve the description and documentation of function
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
1 parent 393fad4 commit d0e1386

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

etc/scripts/deps_archive.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434

3535
from commoncode.system import on_windows
3636

37-
def generate_os_archive(links, requirement, output_file):
37+
def generate_os_archive(links, requirement, archive_name):
3838
"""
39-
Generate an archive as an outtput_file for specific OS
40-
and python by taking links, requirement_file as an input.
39+
Generate an archive as `archive_name.tar.gz` and `archive_name` directory
40+
that contains wheels and sdist for specific OS and python by taking links,
41+
requirement as an input.
4142
"""
4243
pip_agrs =[
4344
'pip',
@@ -50,11 +51,11 @@ def generate_os_archive(links, requirement, output_file):
5051
'-r',
5152
requirement,
5253
'--dest',
53-
'my_deps',
54+
archive_name,
5455
]
5556
run(pip_agrs)
56-
root_dir = os.path.abspath('my_deps')
57-
output_dir = os.path.abspath(output_file)
57+
root_dir = os.path.abspath(archive_name)
58+
output_dir = os.path.abspath(archive_name)
5859
if on_windows:
5960
make_archive(output_dir, 'zip', root_dir)
6061
else:
@@ -63,7 +64,9 @@ def generate_os_archive(links, requirement, output_file):
6364

6465
def main_with_args(args: str) -> None:
6566
parser = argparse.ArgumentParser(
66-
description="""Creates a archive for specific OS and specific python.
67+
description="""Generate an archive as `archive_name.tar.gz` and `archive_name` directory
68+
that contains wheels and sdist for specific OS and python by taking links,
69+
requirement as an input.
6770
""",
6871
formatter_class=argparse.RawDescriptionHelpFormatter,
6972
)
@@ -83,7 +86,7 @@ def main_with_args(args: str) -> None:
8386
)
8487

8588
parser.add_argument(
86-
'--output-filename',
89+
'--archive-name',
8790
help='Required: The Generated archive file name without extension.',
8891
type=str,
8992
required=True,
@@ -93,8 +96,8 @@ def main_with_args(args: str) -> None:
9396

9497
find_links = args.find_links
9598
requirement = args.requirement
96-
output_filename = args.output_filename
97-
generate_os_archive(find_links, requirement, output_filename)
99+
archive_name = args.archive_name
100+
generate_os_archive(find_links, requirement, archive_name)
98101

99102

100103
def main() -> None:

0 commit comments

Comments
 (0)