Skip to content

Commit

Permalink
Fix formatting issues after upgrading black
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum committed Mar 23, 2023
1 parent 731d86b commit 53f3799
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 17 deletions.
5 changes: 0 additions & 5 deletions api/src/backend_common/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class AuthType(enum.Enum):


class BaseUser(object):

anonymous = False
type = AuthType.NONE

Expand Down Expand Up @@ -72,7 +71,6 @@ def get_id(self):
raise NotImplementedError

def has_permissions(self, permissions):

if not isinstance(permissions, (tuple, list)):
permissions = [permissions]

Expand Down Expand Up @@ -105,7 +103,6 @@ def create_auth0_secrets_file(auth_client_id, auth_client_secret, auth_domain):


class AnonymousUser(BaseUser):

anonymous = True
type = AuthType.ANONYMOUS

Expand All @@ -118,7 +115,6 @@ def get_id(self):

# We user TaskclusterUser for scriptworker actions (ship method for xpi manifest)
class TaskclusterUser(BaseUser):

type = AuthType.TASKCLUSTER

def __init__(self, credentials):
Expand Down Expand Up @@ -162,7 +158,6 @@ def has_permissions(self, permissions):


class Auth0User(BaseUser):

type = AuthType.AUTH0

def __init__(self, token, userinfo):
Expand Down
1 change: 0 additions & 1 deletion api/src/backend_common/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def init_database(app):
migrations_dir = os.path.abspath(os.path.join(app.root_path, "..", "migrations"))

with app.app_context():

if os.path.isdir(migrations_dir):
# Needed to init potential migrations later on
# Use a separate alembic_version table per app
Expand Down
1 change: 0 additions & 1 deletion api/src/backend_common/pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def publish(self, exchange_name, routing_key, payload):


def init_app(app):

return Pulse(
app.config.get("PULSE_HOST"),
app.config.get("PULSE_PORT"),
Expand Down
1 change: 0 additions & 1 deletion api/src/backend_common/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def client(app):
"""A Flask test client for uplift/backend with mockups enabled."""
with app.test_client() as client:
with requests_mock:

if hasattr(app, "auth"):
requests_mock.add_callback(
responses.POST, "https://auth.taskcluster.net/v1/authenticate-hawk", callback=mock_auth_taskcluster, content_type="application/json"
Expand Down
12 changes: 3 additions & 9 deletions api/src/shipit_api/admin/product_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def to_format(d: datetime.datetime, format: str) -> str:


def create_index_listing_html(folder: pathlib.Path, items: typing.Set[pathlib.Path]) -> str:

folder = "/" / folder # noqa : T484 Unsupported left operand type for / ("str")
with io.StringIO() as html:

Expand Down Expand Up @@ -185,7 +184,6 @@ def create_index_listing(product_details: ProductDetails) -> ProductDetails:
async def fetch_l10n_data(
session: aiohttp.ClientSession, release: shipit_api.common.models.Release, raise_on_failure: bool, use_cache: bool = True
) -> typing.Tuple[shipit_api.common.models.Release, typing.Optional[ReleaseL10ns]]:

# Fenix and some thunderbird on the betas don't have l10n in the repository
if (
Product(release.product) is Product.THUNDERBIRD
Expand Down Expand Up @@ -232,7 +230,6 @@ async def fetch_l10n_data(


def get_old_product_details(directory: str) -> ProductDetails:

if not os.path.isdir(directory):
return dict()

Expand Down Expand Up @@ -264,7 +261,6 @@ def get_releases_from_db(db_session: sqlalchemy.orm.Session, breakpoint_version:


def get_product_categories(product: Product, version: str) -> typing.List[ProductCategory]:

# typically, these are dot releases that are considered major
SPECIAL_FIREFOX_MAJORS = ["14.0.1"]
SPECIAL_THUNDERBIRD_MAJORS = ["14.0.1", "38.0.1"]
Expand Down Expand Up @@ -295,7 +291,7 @@ def patternize_versions(versions):
else:
categories_mapping.append((ProductCategory.ESR, shipit_api.common.config.CURRENT_ESR + r"(\.[0-9]+){1,2}esr$"))

for (product_category, version_pattern) in categories_mapping:
for product_category, version_pattern in categories_mapping:
if re.match(version_pattern, version):
categories.append(product_category)

Expand Down Expand Up @@ -332,7 +328,6 @@ def get_releases(
details = dict()

for product in products:

#
# get release details from the JSON files up to breakpoint_version
#
Expand Down Expand Up @@ -727,7 +722,7 @@ def get_l10n(
# populate with old data first, stripping the '1.0/' prefix
data: ProductDetails = {file_.replace("1.0/", ""): content for file_, content in old_product_details.items() if file_.startswith("1.0/l10n/")}

for (release, locales) in releases_l10n.items():
for release, locales in releases_l10n.items():
# XXX: for some reason we didn't generate l10n for devedition in old_product_details
# XXX need anything for pinebuild here?
if Product(release.product) is Product.DEVEDITION:
Expand Down Expand Up @@ -991,7 +986,6 @@ async def rebuild(
breakpoint_version: typing.Optional[int],
clean_working_copy: bool = True,
):

secrets = [urllib.parse.urlparse(git_repo_url).password]

# Sometimes we want to work from a clean working copy
Expand Down Expand Up @@ -1133,7 +1127,7 @@ async def rebuild(
if shipit_api.common.config.PRODUCT_DETAILS_NEW_DIR.exists():
shutil.rmtree(shipit_api.common.config.PRODUCT_DETAILS_NEW_DIR)

for (file__, content) in product_details.items():
for file__, content in product_details.items():
new_file = shipit_api.common.config.PRODUCT_DETAILS_NEW_DIR / file__

# we must ensure that all needed folders exists
Expand Down

0 comments on commit 53f3799

Please sign in to comment.