Skip to content

Commit

Permalink
Automatic style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-clickhouse committed Oct 23, 2024
1 parent 5a176dd commit eafa43f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 26 deletions.
3 changes: 1 addition & 2 deletions praktika/__main__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import argparse
import sys

from praktika.utils import Utils

from praktika.html_prepare import Html
from praktika.utils import Utils
from praktika.validator import Validator
from praktika.yaml_generator import YamlGenerator

Expand Down
4 changes: 1 addition & 3 deletions praktika/_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ def get_report_url(self):
if bucket in path:
path = path.replace(bucket, endpoint)
break
REPORT_URL = (
f"https://{path}/{Path(Settings.HTML_PAGE_FILE).name}?PR={self.PR_NUMBER}&sha={self.SHA}&name_0={urllib.parse.quote(self.WORKFLOW_NAME, safe='')}&name_1={urllib.parse.quote(self.JOB_NAME, safe='')}"
)
REPORT_URL = f"https://{path}/{Path(Settings.HTML_PAGE_FILE).name}?PR={self.PR_NUMBER}&sha={self.SHA}&name_0={urllib.parse.quote(self.WORKFLOW_NAME, safe='')}&name_1={urllib.parse.quote(self.JOB_NAME, safe='')}"
return REPORT_URL


Expand Down
1 change: 0 additions & 1 deletion praktika/cidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Optional

import requests

from praktika._environment import _Environment
from praktika.result import Result
from praktika.settings import Settings
Expand Down
1 change: 0 additions & 1 deletion praktika/execution/machine_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import traceback

import requests

from praktika.execution.execution_settings import ExecutionSettings, ScalingType
from praktika.utils import ContextManager, Shell

Expand Down
1 change: 0 additions & 1 deletion praktika/gh_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import requests
from jwt import JWT, jwk_from_pem

from praktika import Workflow
from praktika.mangle import _get_workflows
from praktika.settings import Settings
Expand Down
6 changes: 3 additions & 3 deletions praktika/hook_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ def configure(cls, _workflow):
if job.name in workflow_config.cache_success:
if job.provides:
for artifact_name in job.provides:
workflow_config.cache_artifacts[
artifact_name
] = job_to_cache_record[job.name]
workflow_config.cache_artifacts[artifact_name] = (
job_to_cache_record[job.name]
)

print(f"Write config to GH's job output")
with open(_Environment.get().JOB_OUTPUT_STREAM, "a", encoding="utf8") as f:
Expand Down
2 changes: 1 addition & 1 deletion praktika/hook_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def configure(cls, _workflow):
)
for bucket, endpoint in Settings.S3_BUCKET_TO_HTTP_ENDPOINT.items():
page_url = page_url.replace(bucket, endpoint)
#TODO: add support for non-PRs (use branch?)
# TODO: add support for non-PRs (use branch?)
page_url += f"?PR={env.PR_NUMBER}&sha=latest&name_0={urllib.parse.quote(env.WORKFLOW_NAME, safe='')}"
summary_result.html_link = page_url

Expand Down
22 changes: 11 additions & 11 deletions praktika/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def parse(self):
assert (
job.name not in self.workflow_yaml_config.artifact_to_config
), f"Not uniq Job name [{job.name}], workflow [{self.workflow_name}]"
self.workflow_yaml_config.artifact_to_config[
job.name
] = WorkflowYaml.ArtifactYaml(
name=job.name,
provided_by=job.name,
required_by=[],
path="",
type=Artifact.Type.PHONY,
self.workflow_yaml_config.artifact_to_config[job.name] = (
WorkflowYaml.ArtifactYaml(
name=job.name,
provided_by=job.name,
required_by=[],
path="",
type=Artifact.Type.PHONY,
)
)

# populate jobs
Expand Down Expand Up @@ -151,9 +151,9 @@ def parse(self):
path=artifact.path,
type=artifact.type,
)
self.workflow_yaml_config.artifact_to_config[
artifact.name
] = artifact_yaml_config
self.workflow_yaml_config.artifact_to_config[artifact.name] = (
artifact_yaml_config
)

# populate ArtifactYaml.provided_by
for job in self.config.jobs:
Expand Down
3 changes: 2 additions & 1 deletion praktika/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from praktika._environment import _Environment
from praktika._settings import _Settings
from praktika.utils import MetaClasses, Utils, ContextManager, Shell
from praktika.utils import ContextManager, MetaClasses, Shell, Utils


@dataclasses.dataclass
Expand Down Expand Up @@ -35,6 +35,7 @@ class Result(MetaClasses.Serializable):
Inner Class:
Status: Defines possible statuses for the task, such as "success", "failure", etc.
"""

class Status:
SKIPPED = "skipped"
SUCCESS = "success"
Expand Down
3 changes: 1 addition & 2 deletions praktika/workflow.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from dataclasses import dataclass, field
from typing import List, Optional

from praktika.utils import Utils

from praktika import Artifact, Job
from praktika.docker import Docker
from praktika.secret import Secret
from praktika.utils import Utils


class Workflow:
Expand Down

0 comments on commit eafa43f

Please sign in to comment.