Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding missing docstrings to twine/commands #799

Merged
merged 17 commits into from Sep 20, 2021
Merged
2 changes: 2 additions & 0 deletions twine/commands/check.py
Expand Up @@ -106,6 +106,7 @@ def check(
output_stream: IO[str] = sys.stdout,
strict: bool = False,
) -> bool:
"""Print output of checking."""
bhrutledge marked this conversation as resolved.
Show resolved Hide resolved
uploads = [i for i in commands._find_dists(dists) if not i.endswith(".asc")]
if not uploads: # Return early, if there are no files to check.
output_stream.write("No files to check.\n")
Expand Down Expand Up @@ -146,6 +147,7 @@ def check(


def main(args: List[str]) -> bool:
"""Set command line arguments."""
bhrutledge marked this conversation as resolved.
Show resolved Hide resolved
parser = argparse.ArgumentParser(prog="twine check")
parser.add_argument(
"dists",
Expand Down
2 changes: 2 additions & 0 deletions twine/commands/register.py
Expand Up @@ -21,6 +21,7 @@


def register(register_settings: settings.Settings, package: str) -> None:
"""Register package to repository."""
repository_url = cast(str, register_settings.repository_config["repository"])
print(f"Registering package to {repository_url}")
repository = register_settings.create_repository()
Expand All @@ -45,6 +46,7 @@ def register(register_settings: settings.Settings, package: str) -> None:


def main(args: List[str]) -> None:
"""Set command line arguments."""
parser = argparse.ArgumentParser(
prog="twine register",
description="register operation is not required with PyPI.org",
Expand Down
3 changes: 3 additions & 0 deletions twine/commands/upload.py
Expand Up @@ -30,6 +30,7 @@
def skip_upload(
response: requests.Response, skip_existing: bool, package: package_file.PackageFile
) -> bool:
"""Skip uploading distributions when getting errors."""
if not skip_existing:
return False

Expand Down Expand Up @@ -75,6 +76,7 @@ def _make_package(


def upload(upload_settings: settings.Settings, dists: List[str]) -> None:
"""Upload distributions to repository."""
dists = commands._find_dists(dists)
# Determine if the user has passed in pre-signed distributions
signatures = {os.path.basename(d): d for d in dists if d.endswith(".asc")}
Expand Down Expand Up @@ -135,6 +137,7 @@ def upload(upload_settings: settings.Settings, dists: List[str]) -> None:


def main(args: List[str]) -> None:
"""Set command line arguments."""
parser = argparse.ArgumentParser(prog="twine upload")
settings.Settings.register_argparse_arguments(parser)
parser.add_argument(
Expand Down