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

Commit 345ee75

Browse files
committed
Deprecate login command
1 parent 3ec7c76 commit 345ee75

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

paperspace/cli/auth.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
import click
22

3-
from paperspace import client, config
3+
from paperspace import logger
44
from paperspace.cli import common
55
from paperspace.cli.cli import cli
6-
from paperspace.cli.validators import validate_email
76
from paperspace.commands import login as login_commands
87

8+
LOGIN_DEPRECATION_MESSAGE = """The login command is currently disabled for logging in with `--email` and `--password`.
99
10-
@cli.command("login", help="Log in with email and password")
10+
Instead, obtain an API Key from https://www.paperspace.com/console/account/api and then use the `apiKey` command to store your API Key.
11+
12+
Visit the docs @ https://docs.paperspace.com for more info!"""
13+
14+
15+
@cli.command("login", help=LOGIN_DEPRECATION_MESSAGE, hidden=True)
1116
@click.option(
1217
"--email",
1318
"email",
14-
required=True,
15-
callback=validate_email,
1619
help="Email used to create Paperspace account",
1720
)
1821
@click.option(
1922
"--password",
2023
"password",
21-
prompt=True,
22-
hide_input=True,
2324
help="Password used to create Paperspace account",
2425
)
2526
@click.option(
2627
"--apiTokenName",
2728
"api_token_name",
2829
help="Name of api token used to log in",
2930
)
30-
def login(email, password, api_token_name):
31-
machines_api = client.API(config.CONFIG_HOST)
32-
command = login_commands.LogInCommand(api=machines_api)
33-
command.execute(email, password, api_token_name)
31+
def login(**kwargs):
32+
logger.warning(LOGIN_DEPRECATION_MESSAGE)
3433

3534

3635
@cli.command("logout", help="Log out / remove apiKey from config file")

0 commit comments

Comments
 (0)