Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 86ca10d

Browse files
committed
redundant imports removed
1 parent 3344fd4 commit 86ca10d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

paperspace/cli/jobs.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import click
22

33
from paperspace import client, config
4-
from paperspace.cli import common
5-
from paperspace.cli.cli_types import json_string
6-
from paperspace.cli.common import del_if_value_is_none, ClickGroup
74
from paperspace.cli.cli import cli
5+
from paperspace.cli.cli_types import json_string
6+
from paperspace.cli.common import api_key_option, del_if_value_is_none, ClickGroup
87
from paperspace.commands import jobs as jobs_commands
98

109

@@ -20,7 +19,7 @@ def jobs_group():
2019
required=True,
2120
help="Delete job with given ID",
2221
)
23-
@common.api_key_option
22+
@api_key_option
2423
def delete_job(job_id, api_key=None):
2524
jobs_api = client.API(config.CONFIG_HOST, api_key=api_key)
2625
command = jobs_commands.DeleteJobCommand(api=jobs_api)
@@ -34,7 +33,7 @@ def delete_job(job_id, api_key=None):
3433
required=True,
3534
help="Stop job with given ID",
3635
)
37-
@common.api_key_option
36+
@api_key_option
3837
def stop_job(job_id, api_key=None):
3938
jobs_api = client.API(config.CONFIG_HOST, api_key=api_key)
4039
command = jobs_commands.StopJobCommand(api=jobs_api)
@@ -57,9 +56,9 @@ def stop_job(job_id, api_key=None):
5756
"experimentId",
5857
help="Use to filter jobs by experiment ID",
5958
)
60-
@common.api_key_option
59+
@api_key_option
6160
def list_jobs(api_key, **filters):
62-
common.del_if_value_is_none(filters)
61+
del_if_value_is_none(filters)
6362
jobs_api = client.API(config.CONFIG_HOST, api_key=api_key)
6463
command = jobs_commands.ListJobsCommand(api=jobs_api)
6564
command.execute(filters)
@@ -86,7 +85,7 @@ def list_jobs(api_key, **filters):
8685
@click.option("--relDockerfilePath", "relDockerfilePath", help="Relative path to Dockerfile")
8786
@click.option("--registryUsername", "registryUsername", help="Docker registry username")
8887
@click.option("--registryPassword", "registryPassword", help="Docker registry password")
89-
@common.api_key_option
88+
@api_key_option
9089
def create_job(api_key, **kwargs):
9190
del_if_value_is_none(kwargs)
9291
jobs_api = client.API(config.CONFIG_HOST, api_key=api_key)
@@ -100,7 +99,7 @@ def create_job(api_key, **kwargs):
10099
"job_id",
101100
required=True
102101
)
103-
@common.api_key_option
102+
@api_key_option
104103
def list_logs(job_id, api_key=None):
105104
logs_api = client.API(config.CONFIG_LOG_HOST, api_key=api_key)
106105
command = jobs_commands.JobLogsCommand(api=logs_api)
@@ -110,7 +109,7 @@ def list_logs(job_id, api_key=None):
110109
@jobs_group.command("artifactsDestroy", help="Destroy job's artifacts")
111110
@click.argument("job_id")
112111
@click.option("--files", "files")
113-
@common.api_key_option
112+
@api_key_option
114113
def destroy_artifacts(job_id, api_key=None, files=None):
115114
jobs_api = client.API(config.CONFIG_HOST, api_key=api_key)
116115
command = jobs_commands.ArtifactsDestroyCommand(api=jobs_api)

0 commit comments

Comments
 (0)