Adjust the toddler sources for the new version of black >= 20.8b0

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-09-02 09:31:23 +02:00
parent 40aef23237
commit a85d3006c1
14 changed files with 41 additions and 40 deletions

View file

@ -629,7 +629,8 @@ class TestPDCImportComposeToddler:
output = list(
toddlers.plugins.pdc_import_compose._scrape_links(
session=session, url="https://kojipkgs.fedoraproject.org/..",
session=session,
url="https://kojipkgs.fedoraproject.org/..",
)
)
assert (
@ -919,7 +920,8 @@ class TestPDCImportComposeToddler:
)
with pytest.raises(
beanbag.bbexcept.BeanBagException, match=r"Failed to create the release .*",
beanbag.bbexcept.BeanBagException,
match=r"Failed to create the release .*",
):
toddlers.plugins.pdc_import_compose.ensure_release_exists(
pdc, "release-id", {"foo": "bar"}

View file

@ -56,7 +56,8 @@ class TestRunningToddler:
toddler_list.append(tod)
base_tod.__subclasses__.return_value = toddler_list
with pytest.raises(
ValueError, match=r"Toddler named flag_ci_pr already exists.",
ValueError,
match=r"Toddler named flag_ci_pr already exists.",
):
toddlers.runner.RunningToddler()

View file

@ -47,10 +47,12 @@ def get_arguments(args):
"(if that toddlers supports being triggered this way)."
)
parser.add_argument(
"name", help="Name of the toddler to trigger",
"name",
help="Name of the toddler to trigger",
)
parser.add_argument(
"--conf", help="Fedora-messaging configuration file to use",
"--conf",
help="Fedora-messaging configuration file to use",
)
log_level_group = parser.add_mutually_exclusive_group()

View file

@ -129,7 +129,8 @@ def get_arguments(args):
description="Check the state of the email_overrides file"
)
parser.add_argument(
"conf", help="Configuration file",
"conf",
help="Configuration file",
)
parser.add_argument(
"--dry-run",
@ -190,7 +191,9 @@ def main(args):
config = merge_dicts(default_config, private_config)
CheckEmailOverrides().process(
config=config, message={}, dry_run=args.dry_run,
config=config,
message={},
dry_run=args.dry_run,
)

View file

@ -162,8 +162,7 @@ Have a wonderful day and see you (maybe?) at the next run!
)
def orphan_package(self, namespace, name, current_poc):
""" Give the specified project on dist_git to the ``orphan`` user.
"""
"""Give the specified project on dist_git to the ``orphan`` user."""
# Orphan the package
url = f"{self.dist_git_url}/_dg/orphan/{namespace}/{name}"

View file

@ -134,7 +134,8 @@ def get_arguments(args):
description="Sync packagers access from FAS to bugzilla"
)
parser.add_argument(
"conf", help="Configuration file",
"conf",
help="Configuration file",
)
parser.add_argument(
"--dry-run",

View file

@ -11,8 +11,7 @@ _BUGZILLA = None
def set_bz(conf: Mapping[str, str]) -> Bugzilla:
""" Set the connection bugzilla.
"""
"""Set the connection bugzilla."""
global _BUGZILLA
# Get a connection to bugzilla

View file

@ -9,8 +9,7 @@ _FAS = None
def set_fas(conf: Mapping[str, str]) -> AccountSystem:
""" Set the connection to the Fedora Account System.
"""
"""Set the connection to the Fedora Account System."""
global _FAS
# Get a connection to FAS
@ -34,8 +33,7 @@ def set_fas(conf: Mapping[str, str]) -> AccountSystem:
def get_fas() -> AccountSystem:
""" Retrieve a connection to the Fedora Account System.
"""
"""Retrieve a connection to the Fedora Account System."""
global _FAS
if _FAS is None:
raise ValueError("No FAS connection set, call set_fas first")
@ -44,8 +42,7 @@ def get_fas() -> AccountSystem:
def __get_fas_grp_member(group: str = "packager") -> Mapping[str, Mapping[str, Any]]:
""" Retrieve from FAS the list of users in the packager group.
"""
"""Retrieve from FAS the list of users in the packager group."""
fas = get_fas()
return fas.group_members(group)
@ -61,8 +58,7 @@ def get_group_member(group_name: str) -> set:
def get_bz_email_user(username, email_overrides):
""" Retrieve the bugzilla email associated to the provided username.
"""
"""Retrieve the bugzilla email associated to the provided username."""
fas = get_fas()
user_info = fas.person_by_username(username)
@ -76,8 +72,7 @@ def get_bz_email_user(username, email_overrides):
def get_bz_email_group(groupname, email_overrides):
""" Retrieve the bugzilla email associated to the provided group name.
"""
"""Retrieve the bugzilla email associated to the provided group name."""
fas = get_fas()
group = fas.group_by_name(groupname)
@ -91,8 +86,7 @@ def get_bz_email_group(groupname, email_overrides):
def get_user_by_email(email: str) -> dict:
""" Returns the user found in FAS for that email address.
"""
"""Returns the user found in FAS for that email address."""
fas = get_fas()
user = fas.people_query(constraints={"email": email})