This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/main by this push:
new ec84c82 Fix unparenthesized subexpressions
ec84c82 is described below
commit ec84c82ce4cff74c805cabc99409e611095c93a0
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Jan 21 20:06:34 2026 +0000
Fix unparenthesized subexpressions
---
atr/get/distribution.py | 12 ++++++------
atr/get/finish.py | 8 ++++----
atr/storage/writers/distributions.py | 6 +++---
atr/storage/writers/tokens.py | 2 +-
atr/tasks/gha.py | 2 +-
atr/tasks/metadata.py | 2 +-
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/atr/get/distribution.py b/atr/get/distribution.py
index ab089a2..7bc9162 100644
--- a/atr/get/distribution.py
+++ b/atr/get/distribution.py
@@ -199,8 +199,8 @@ async def _get_page_data(project_name: str, version_name:
str) -> tuple[Sequence
.order_by(sql.sqlmodel.desc(via(sql.Task.started)))
.all()
)
- if t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE,
sql.TaskStatus.FAILED]
- or (t.workflow and t.workflow.status in ["in-progress", "failed"])
+ if (t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE,
sql.TaskStatus.FAILED])
+ or (t.workflow and (t.workflow.status in ["in-progress",
"failed"]))
]
return distributions, tasks
@@ -248,13 +248,13 @@ async def _record_form_page(project: str, version: str,
staging: bool) -> str:
def _render_distribution_tasks(tasks: Sequence[sql.Task], block: htm.Block,
project_name: str, version_name: str):
failed_tasks = [
- t for t in tasks if t.status == sql.TaskStatus.FAILED or (t.workflow
and t.workflow.status == "failed")
+ t for t in tasks if (t.status == sql.TaskStatus.FAILED) or (t.workflow
and (t.workflow.status == "failed"))
]
in_progress_tasks = [
t
for t in tasks
- if t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE]
- or (t.workflow and t.workflow.status not in ["completed", "success",
"failed"])
+ if (t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE])
+ or (t.workflow and (t.workflow.status not in ["completed", "success",
"failed"]))
]
if len(failed_tasks) > 0:
summary = f"{len(failed_tasks)} distribution{'s' if (len(failed_tasks)
!= 1) else ''} failed for this version"
@@ -292,7 +292,7 @@ def _render_task(task: sql.Task) -> htm.Element:
task_status = task.status.value
workflow_status = task.workflow.status if task.workflow else ""
workflow_message = (
- task.workflow.message if task.workflow and task.workflow.message else
workflow_status.capitalize()
+ task.workflow.message if (task.workflow and task.workflow.message)
else workflow_status.capitalize()
)
if task_status != sql.TaskStatus.COMPLETED:
return htm.details(".ms-4")[
diff --git a/atr/get/finish.py b/atr/get/finish.py
index a715d32..d82ded7 100644
--- a/atr/get/finish.py
+++ b/atr/get/finish.py
@@ -226,13 +226,13 @@ def _render_distribution_buttons(release: sql.Release) ->
htm.Element:
def _render_distribution_tasks(release: sql.Release, tasks:
Sequence[sql.Task]) -> htm.Element:
"""Render current and failed distribution tasks."""
failed_tasks = [
- t for t in tasks if t.status == sql.TaskStatus.FAILED or (t.workflow
and t.workflow.status == "failed")
+ t for t in tasks if (t.status == sql.TaskStatus.FAILED) or (t.workflow
and (t.workflow.status == "failed"))
]
in_progress_tasks = [
t
for t in tasks
- if t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE]
- or (t.workflow and t.workflow.status not in ["completed", "success",
"failed"])
+ if (t.status in [sql.TaskStatus.QUEUED, sql.TaskStatus.ACTIVE])
+ or (t.workflow and (t.workflow.status not in ["completed", "success",
"failed"]))
]
block = htm.Block()
@@ -552,7 +552,7 @@ def _render_task(task: sql.Task) -> htm.Element:
task_status = task.status.value
workflow_status = task.workflow.status if task.workflow else ""
workflow_message = (
- task.workflow.message if task.workflow and task.workflow.message else
workflow_status.capitalize()
+ task.workflow.message if (task.workflow and task.workflow.message)
else workflow_status.capitalize()
)
if task_status != sql.TaskStatus.COMPLETED:
return htm.details(".ms-4")[
diff --git a/atr/storage/writers/distributions.py
b/atr/storage/writers/distributions.py
index d620592..484cb60 100644
--- a/atr/storage/writers/distributions.py
+++ b/atr/storage/writers/distributions.py
@@ -402,7 +402,7 @@ class CommitteeMember(CommitteeParticipant):
# Get lastUpdated timestamp (format: yyyyMMddHHmmss)
last_updated_elem = versioning.find("lastUpdated")
- if last_updated_elem is None or not last_updated_elem.text:
+ if (last_updated_elem is None) or (not last_updated_elem.text):
e = RuntimeError("No lastUpdated timestamp found in Maven
metadata")
return outcome.Error(e)
@@ -426,8 +426,8 @@ class CommitteeMember(CommitteeParticipant):
"start": 0,
"docs": [
{
- "g": group.text if group is not None else "",
- "a": artifact.text if artifact is not None else "",
+ "g": group.text if (group is not None) else "",
+ "a": artifact.text if (artifact is not None) else
"",
"v": version,
"timestamp": timestamp_ms,
}
diff --git a/atr/storage/writers/tokens.py b/atr/storage/writers/tokens.py
index 89259eb..fe57158 100644
--- a/atr/storage/writers/tokens.py
+++ b/atr/storage/writers/tokens.py
@@ -90,7 +90,7 @@ class FoundationCommitter(GeneralPublic):
sql.PersonalAccessToken.token_hash == pat_hash,
)
)
- if pat is None or pat.expires < datetime.datetime.now(datetime.UTC):
+ if (pat is None) or (pat.expires <
datetime.datetime.now(datetime.UTC)):
raise storage.AccessError("Authentication failed")
issued_jwt = jwtoken.issue(self.__asf_uid)
pat.last_used = datetime.datetime.now(datetime.UTC)
diff --git a/atr/tasks/gha.py b/atr/tasks/gha.py
index a13a016..5e3a628 100644
--- a/atr/tasks/gha.py
+++ b/atr/tasks/gha.py
@@ -153,7 +153,7 @@ async def status_check(args: WorkflowStatusCheck) ->
DistributionWorkflowStatus:
(
r
for r in runs
- if r.get("id") == pending.run_id and r.get("path",
"").endswith(f"/{pending.workflow_id}")
+ if (r.get("id") == pending.run_id) and
r.get("path", "").endswith(f"/{pending.workflow_id}")
),
None,
)
diff --git a/atr/tasks/metadata.py b/atr/tasks/metadata.py
index 81e070a..5de4b77 100644
--- a/atr/tasks/metadata.py
+++ b/atr/tasks/metadata.py
@@ -52,7 +52,7 @@ async def update(args: Update) -> results.Results | None:
)
# Schedule next update
- if args.next_schedule_seconds and args.next_schedule_seconds > 0:
+ if args.next_schedule_seconds and (args.next_schedule_seconds > 0):
next_schedule = datetime.datetime.now(datetime.UTC) +
datetime.timedelta(seconds=args.next_schedule_seconds)
await tasks.metadata_update(args.asf_uid, schedule=next_schedule,
schedule_next=True)
log.info(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]