Skip to content

Commit

Permalink
πŸ”₯ Remove password arg from API (#839)
Browse files Browse the repository at this point in the history
* πŸ”₯ Remove password arg from API

* πŸ’š Attempt fixing test

* ♻️ Install from github

* Fix install
  • Loading branch information
falexwolf committed Sep 3, 2024
1 parent 888f328 commit bc17873
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
8 changes: 4 additions & 4 deletions docs/hub-prod/test-insufficient-user-info.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If we add an email or handle it looks up the password from the stored env file (`lamin login [email protected]`):"
"If we add an email or handle it looks up credentials from the stored env file (`lamin login [email protected]`):"
]
},
{
Expand Down Expand Up @@ -103,15 +103,15 @@
"outputs": [],
"source": [
"with pytest.raises(SystemExit):\n",
" ln_setup.login(\"testuser1\", password=\"dummy\")"
" ln_setup.login(\"testuser1\", key=\"dummy\")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"If we try to login without password, this will error:"
"If we try to login without key, this will error:"
]
},
{
Expand All @@ -129,7 +129,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If we try login with a wrong password, this will error:"
"If we try login with a wrong key, this will error:"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions docs/hub-prod/test-sqlite-lock.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
{
"cell_type": "code",
"execution_count": null,
"id": "89b7057a",
"id": "69eeefee",
"metadata": {},
"outputs": [],
"source": [
"!lamin login testuser2"
"import pytest\n",
"import lamindb_setup as ln_setup\n",
"from lamindb_setup.core.cloud_sqlite_locker import Locker, InstanceLockedException\n",
"from lamindb_setup.core.upath import UPath"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69eeefee",
"id": "5605dfcd",
"metadata": {},
"outputs": [],
"source": [
"import pytest\n",
"import lamindb_setup as ln_setup\n",
"from lamindb_setup.core.cloud_sqlite_locker import Locker, InstanceLockedException\n",
"from lamindb_setup.core.upath import UPath"
"ln_setup.login(\"testuser2\")"
]
},
{
Expand Down
11 changes: 1 addition & 10 deletions lamindb_setup/_setup_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ def login(
user: str,
*,
key: str | None = None,
password: str | None = None, # for backward compat
) -> None:
"""Log in user.
Args:
user: handle or email
key: API key or legacy passward
password: Backward compat, will be removed
key: API key
"""
if "@" in user:
email, handle = user, None
Expand All @@ -64,13 +62,6 @@ def login(

user_settings = load_or_create_user_settings()

if password is not None:
logger.warning(
"please use --key instead of --password, "
"passwords are deprecated and replaced with API keys"
)
key = password

if key is not None:
# within UserSettings, we still call it "password" for a while
user_settings.password = key
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def lint(session: nox.Session) -> None:
["hub-local", "hub-prod", "hub-cloud", "storage", "docs"],
)
def install(session: nox.Session, group: str) -> None:
no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab lamin-cli"
no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab git+https://github.com/laminlabs/lamin-cli"
schema_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty git+https://github.com/laminlabs/lamindb@main
uv pip install --system --no-deps {no_deps_packages}
"""
Expand Down

0 comments on commit bc17873

Please sign in to comment.