lamindb_setup 1.0.1__tar.gz → 1.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/PKG-INFO +1 -1
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/__init__.py +1 -1
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_connect_instance.py +18 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-local/test_all.py +6 -3
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/.github/workflows/build.yml +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/.github/workflows/doc-changes.yml +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/.gitignore +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/.pre-commit-config.yaml +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/LICENSE +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/README.md +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/changelog.md +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-cloud/test_notebooks.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-cache-management.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-empty-init.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-import-schema.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test_notebooks2.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/index.md +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/notebooks.md +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/reference.md +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_cache.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_check.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_check_setup.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_close.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_delete.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_django.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_entry_points.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_exportdb.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_importdb.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_init_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_migrate.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_register_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_schema.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_schema_metadata.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_set_managed_storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_setup_user.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/_silence_loggers.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/__init__.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_aws_credentials.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_aws_storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_deprecated.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_docs.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_hub_client.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_hub_core.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_hub_crud.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_hub_utils.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_private_django_api.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_load.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_save.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_store.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_settings_user.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/django.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/exceptions.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/hashing.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/types.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/lamindb_setup/core/upath.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/noxfile.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/pyproject.toml +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_connect_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_delete_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_edge_request.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_init_instance.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_login.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_migrate.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_set_storage.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-local/conftest.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-local/test_update_schema_in_hub.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/conftest.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/test_aws_credentials_manager.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/test_django.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/test_global_settings.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-prod/test_upath.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_entry_point.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_hashing.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_storage_access.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_storage_basis.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_storage_stats.py +0 -0
- {lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/storage/test_to_url.py +0 -0
|
@@ -394,6 +394,24 @@ def migrate_lnschema_core(
|
|
|
394
394
|
if response != "y":
|
|
395
395
|
print("Aborted.")
|
|
396
396
|
quit()
|
|
397
|
+
if isettings.is_on_hub:
|
|
398
|
+
from lamindb_setup.core._hub_client import call_with_fallback_auth
|
|
399
|
+
from lamindb_setup.core._hub_crud import (
|
|
400
|
+
select_collaborator,
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
# double check that user is an admin, otherwise will fail below
|
|
404
|
+
# due to insufficient SQL permissions with cryptic error
|
|
405
|
+
collaborator = call_with_fallback_auth(
|
|
406
|
+
select_collaborator,
|
|
407
|
+
instance_id=settings.instance._id,
|
|
408
|
+
account_id=settings.user._uuid,
|
|
409
|
+
)
|
|
410
|
+
if collaborator is None or collaborator["role"] != "admin":
|
|
411
|
+
raise SystemExit(
|
|
412
|
+
"❌ Only admins can deploy migrations, please ensure that you're an"
|
|
413
|
+
f" admin: https://lamin.ai/{settings.instance.slug}/settings"
|
|
414
|
+
)
|
|
397
415
|
for table in tables_to_rename:
|
|
398
416
|
if db_type == "sqlite":
|
|
399
417
|
cur.execute(
|
|
@@ -325,7 +325,10 @@ def test_connect_instance_hub_corrupted_or_expired_credentials(
|
|
|
325
325
|
create_myinstance, create_testadmin1_session
|
|
326
326
|
):
|
|
327
327
|
# assume token & password are corrupted or expired
|
|
328
|
-
|
|
328
|
+
# make realisticly looking token that passes
|
|
329
|
+
# supafunc is_valid_jwt but is actually not a real token
|
|
330
|
+
invalid_token = "header1.payload1.signature1"
|
|
331
|
+
ln_setup.settings.user.access_token = invalid_token
|
|
329
332
|
correct_password = ln_setup.settings.user.password
|
|
330
333
|
ln_setup.settings.user.password = "corrupted_password"
|
|
331
334
|
with pytest.raises(FunctionsHttpError):
|
|
@@ -336,7 +339,7 @@ def test_connect_instance_hub_corrupted_or_expired_credentials(
|
|
|
336
339
|
# now, let's assume only the token is expired or corrupted
|
|
337
340
|
# re-creating the auth client triggers a re-generated token because it
|
|
338
341
|
# excepts the error assuming the token is expired
|
|
339
|
-
ln_setup.settings.user.access_token =
|
|
342
|
+
ln_setup.settings.user.access_token = invalid_token
|
|
340
343
|
ln_setup.settings.user.password = correct_password
|
|
341
344
|
connect_instance_hub(
|
|
342
345
|
owner="testadmin1",
|
|
@@ -344,7 +347,7 @@ def test_connect_instance_hub_corrupted_or_expired_credentials(
|
|
|
344
347
|
)
|
|
345
348
|
# check access_token renewal
|
|
346
349
|
access_token = ln_setup.settings.user.access_token
|
|
347
|
-
assert access_token !=
|
|
350
|
+
assert access_token != invalid_token
|
|
348
351
|
# check that the access_token was written to the settings
|
|
349
352
|
ln_setup.settings._user_settings = None
|
|
350
353
|
assert ln_setup.settings.user.access_token == access_token
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/docs/hub-prod/test-init-load-local-anonymously.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-1.0.1 → lamindb_setup-1.0.3}/tests/hub-cloud/test_init_pass_user_no_writes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|