|
1 | 1 | import click
|
2 | 2 |
|
3 |
| -from paperspace import client, config |
| 3 | +from paperspace import logger |
4 | 4 | from paperspace.cli import common
|
5 | 5 | from paperspace.cli.cli import cli
|
6 |
| -from paperspace.cli.validators import validate_email |
7 | 6 | from paperspace.commands import login as login_commands
|
8 | 7 |
|
| 8 | +LOGIN_DEPRECATION_MESSAGE = """The login command is currently disabled for logging in with `--email` and `--password`. |
9 | 9 |
|
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) |
11 | 16 | @click.option(
|
12 | 17 | "--email",
|
13 | 18 | "email",
|
14 |
| - required=True, |
15 |
| - callback=validate_email, |
16 | 19 | help="Email used to create Paperspace account",
|
17 | 20 | )
|
18 | 21 | @click.option(
|
19 | 22 | "--password",
|
20 | 23 | "password",
|
21 |
| - prompt=True, |
22 |
| - hide_input=True, |
23 | 24 | help="Password used to create Paperspace account",
|
24 | 25 | )
|
25 | 26 | @click.option(
|
26 | 27 | "--apiTokenName",
|
27 | 28 | "api_token_name",
|
28 | 29 | help="Name of api token used to log in",
|
29 | 30 | )
|
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) |
34 | 33 |
|
35 | 34 |
|
36 | 35 | @cli.command("logout", help="Log out / remove apiKey from config file")
|
|
0 commit comments