Skip to content

Commit

Permalink
docs: improve usage messages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell-k committed Aug 31, 2023
1 parent 5f84898 commit 0a544aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
16 changes: 11 additions & 5 deletions build_wheels.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Build wheels from a source distributions (sdists)
"""Build wheels for source distributions
Usage:
Expand Down Expand Up @@ -39,7 +39,6 @@
CONSTRAINTS = {
"wheel==0.41.0",
}
PROG = "build_wheels.py"

# [[[cog
# import cog
Expand Down Expand Up @@ -115,10 +114,17 @@ def build_wheel_from_sdist(sdist: Path, output: Path) -> int:


def main(argv_=argv[1:]) -> int:
parser = ArgumentParser(prog=PROG)
parser = ArgumentParser(
description="Build wheels for source distributions",
)
parser.add_argument("--version", action="version", version=__version__)
parser.add_argument("source_distribution", nargs="+", type=Path)
parser.add_argument("output", type=Path)
parser.add_argument(
"source_distribution",
nargs="+",
type=Path,
help="source distributions to build",
)
parser.add_argument("output", type=Path, help="output directory for built wheels")
args = parser.parse_args(argv_)

if all(i.is_file() for i in args.source_distribution) and args.output.is_dir():
Expand Down
9 changes: 7 additions & 2 deletions cleanse_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ def filter_(tarinfo: tarfile.TarInfo) -> tarfile.TarInfo:

def main(arguments: list[str] = argv):
"""Call cleanse_metadata once for each input"""
parser = ArgumentParser()
parser = ArgumentParser(description="Cleanse metadata from source distributions")
parser.add_argument("--version", action="version", version=__version__)
parser.add_argument("source_distribution", nargs="+", type=Path)
parser.add_argument(
"source_distribution",
nargs="+",
type=Path,
help="source distributions to change in place",
)
args = parser.parse_args(arguments)
returncode = 0
# try all source distributions before exiting with an error
Expand Down

0 comments on commit 0a544aa

Please sign in to comment.