lamindb_setup 0.76.6__tar.gz → 0.76.8__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.
Files changed (94) hide show
  1. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/PKG-INFO +4 -3
  2. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/03-add-managed-storage.ipynb +10 -4
  3. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/__init__.py +1 -1
  4. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_migrate.py +6 -3
  5. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_schema_metadata.py +31 -11
  6. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_client.py +8 -5
  7. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_instance.py +3 -2
  8. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_setup_bionty_sources.py +3 -1
  9. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/noxfile.py +2 -2
  10. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/pyproject.toml +3 -2
  11. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-local/test_all.py +1 -0
  12. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/.github/workflows/build.yml +0 -0
  13. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/.github/workflows/doc-changes.yml +0 -0
  14. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/.gitignore +0 -0
  15. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/.pre-commit-config.yaml +0 -0
  16. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/LICENSE +0 -0
  17. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/README.md +0 -0
  18. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/changelog.md +0 -0
  19. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  20. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  21. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  22. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  23. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  24. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  25. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
  26. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-cloud/test_notebooks.py +0 -0
  27. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-cache-management.ipynb +0 -0
  28. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  29. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  30. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-empty-init.ipynb +0 -0
  31. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-import-schema.ipynb +0 -0
  32. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  33. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  34. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  35. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/hub-prod/test_notebooks2.py +0 -0
  36. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/index.md +0 -0
  37. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/notebooks.md +0 -0
  38. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/docs/reference.md +0 -0
  39. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_cache.py +0 -0
  40. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_check.py +0 -0
  41. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_check_setup.py +0 -0
  42. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_close.py +0 -0
  43. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_connect_instance.py +0 -0
  44. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_delete.py +0 -0
  45. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_django.py +0 -0
  46. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_exportdb.py +0 -0
  47. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_importdb.py +0 -0
  48. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_init_instance.py +0 -0
  49. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_register_instance.py +0 -0
  50. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_schema.py +0 -0
  51. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_set_managed_storage.py +0 -0
  52. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_setup_user.py +0 -0
  53. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/_silence_loggers.py +0 -0
  54. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/__init__.py +0 -0
  55. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_aws_credentials.py +0 -0
  56. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_aws_storage.py +0 -0
  57. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_deprecated.py +0 -0
  58. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_docs.py +0 -0
  59. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_core.py +0 -0
  60. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_crud.py +0 -0
  61. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_hub_utils.py +0 -0
  62. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_private_django_api.py +0 -0
  63. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings.py +0 -0
  64. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_load.py +0 -0
  65. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_save.py +0 -0
  66. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_storage.py +0 -0
  67. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_store.py +0 -0
  68. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/_settings_user.py +0 -0
  69. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  70. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/django.py +0 -0
  71. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/exceptions.py +0 -0
  72. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/hashing.py +0 -0
  73. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/types.py +0 -0
  74. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/lamindb_setup/core/upath.py +0 -0
  75. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
  76. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_connect_instance.py +0 -0
  77. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_delete_instance.py +0 -0
  78. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
  79. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_init_instance.py +0 -0
  80. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_login.py +0 -0
  81. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_migrate.py +0 -0
  82. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-cloud/test_set_storage.py +0 -0
  83. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-local/conftest.py +0 -0
  84. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-local/test_update_schema_in_hub.py +0 -0
  85. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-prod/conftest.py +0 -0
  86. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-prod/test_django.py +0 -0
  87. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-prod/test_global_settings.py +0 -0
  88. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  89. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/hub-prod/test_upath.py +0 -0
  90. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/storage/test_hashing.py +0 -0
  91. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/storage/test_storage_access.py +0 -0
  92. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/storage/test_storage_basis.py +0 -0
  93. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/storage/test_storage_stats.py +0 -0
  94. {lamindb_setup-0.76.6 → lamindb_setup-0.76.8}/tests/storage/test_to_url.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.76.6
3
+ Version: 0.76.8
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Description-Content-Type: text/markdown
@@ -13,11 +13,12 @@ Requires-Dist: appdirs<2.0.0
13
13
  Requires-Dist: requests
14
14
  Requires-Dist: universal_pathlib==0.2.2
15
15
  Requires-Dist: botocore<2.0.0
16
+ Requires-Dist: gotrue>=2.1.0
16
17
  Requires-Dist: supabase==2.2.1
17
18
  Requires-Dist: psutil
18
19
  Requires-Dist: urllib3<2 ; extra == "aws"
19
20
  Requires-Dist: aiobotocore[boto3]>=2.5.4,<3.0.0 ; extra == "aws"
20
- Requires-Dist: s3fs>=2023.12.2,<=2024.3.1 ; extra == "aws"
21
+ Requires-Dist: s3fs>=2023.12.2,<=2024.6.1 ; extra == "aws"
21
22
  Requires-Dist: pyjwt<3.0.0 ; extra == "dev"
22
23
  Requires-Dist: psycopg2-binary ; extra == "dev"
23
24
  Requires-Dist: python-dotenv ; extra == "dev"
@@ -28,7 +29,7 @@ Requires-Dist: pytest-xdist ; extra == "dev"
28
29
  Requires-Dist: nbproject-test>=0.4.3 ; extra == "dev"
29
30
  Requires-Dist: pandas ; extra == "dev"
30
31
  Requires-Dist: django-schema-graph ; extra == "erdiagram"
31
- Requires-Dist: gcsfs>=2023.12.2,<=2024.3.1 ; extra == "gcp"
32
+ Requires-Dist: gcsfs>=2023.12.2,<=2024.6.1 ; extra == "gcp"
32
33
  Project-URL: Home, https://github.com/laminlabs/lamindb-setup
33
34
  Provides-Extra: aws
34
35
  Provides-Extra: dev
@@ -324,14 +324,20 @@
324
324
  "outputs": [],
325
325
  "source": [
326
326
  "from laminhub_rest.core.instance.collaborator import InstanceCollaboratorHandler\n",
327
+ "from laminhub_rest.core.account.user import UserAccountHandler\n",
327
328
  "from lamindb_setup.core._hub_client import connect_hub_with_auth\n",
329
+ "from lnschema_core.models import User\n",
328
330
  "\n",
329
331
  "admin_hub = connect_hub_with_auth()\n",
330
- "InstanceCollaboratorHandler(admin_hub).add_by_slug(\n",
331
- " \"testuser1/test-add-managed-storage\",\n",
332
- " \"testuser2\",\n",
333
- " \"write\"\n",
332
+ "testuser2 = UserAccountHandler(admin_hub).get_by_handle(\"testuser2\")\n",
333
+ "InstanceCollaboratorHandler(admin_hub).add(\n",
334
+ " instance_id=instance_id,\n",
335
+ " account_id=testuser2.id,\n",
336
+ " role=\"write\",\n",
337
+ " schema_id=None,\n",
338
+ " skip_insert_user_table=True\n",
334
339
  ")\n",
340
+ "User.objects.create(uid=testuser2.lnid, handle=testuser2.handle, name=testuser2.name)\n",
335
341
  "admin_hub.auth.close()"
336
342
  ]
337
343
  },
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.76.6" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.76.8" # denote a release candidate for 0.1.0 with 0.1rc1
38
38
 
39
39
  import sys
40
40
  from os import name as _os_name
@@ -31,7 +31,10 @@ def check_whether_migrations_in_sync(db_version_str: str):
31
31
  db_version_upper = f"{db_version.major}.{db_version.minor + 1}"
32
32
  logger.warning(
33
33
  f"your database ({db_version_str}) is ahead of your installed lamindb"
34
- f" package ({installed_version_str}) \n❗ please update lamindb: pip install"
34
+ f" package ({installed_version_str})"
35
+ )
36
+ logger.important(
37
+ "please update lamindb: pip install"
35
38
  f' "lamindb>={db_version_lower},<{db_version_upper}"'
36
39
  )
37
40
  elif (
@@ -40,9 +43,9 @@ def check_whether_migrations_in_sync(db_version_str: str):
40
43
  ):
41
44
  logger.warning(
42
45
  f"your database ({db_version_str}) is behind your installed lamindb package"
43
- f" ({installed_version_str}) \n❗ please migrate your database: lamin"
44
- " migrate deploy"
46
+ f" ({installed_version_str})"
45
47
  )
48
+ logger.important("please migrate your database: lamin migrate deploy")
46
49
 
47
50
 
48
51
  # for tests, see lamin-cli
@@ -95,22 +95,42 @@ def _dict_to_uuid(dict: dict):
95
95
  RelationType = Literal["many-to-one", "one-to-many", "many-to-many", "one-to-one"]
96
96
  Type = Literal[
97
97
  "ForeignKey",
98
- "CharField",
99
- "DateTimeField",
98
+ # the following are generated with `from django.db import models; [attr for attr in dir(models) if attr.endswith('Field')]`
100
99
  "AutoField",
101
- "BooleanField",
102
- "BigIntegerField",
103
- "SmallIntegerField",
104
- "TextField",
105
100
  "BigAutoField",
106
- "ManyToManyField",
107
- "IntegerField",
108
- "OneToOneField",
109
- "JSONField",
101
+ "BigIntegerField",
102
+ "BinaryField",
103
+ "BooleanField",
104
+ "CharField",
105
+ "CommaSeparatedIntegerField",
110
106
  "DateField",
107
+ "DateTimeField",
108
+ "DecimalField",
109
+ "DurationField",
110
+ "EmailField",
111
+ "Field",
112
+ "FileField",
113
+ "FilePathField",
111
114
  "FloatField",
112
- "PositiveIntegerField",
115
+ "GeneratedField",
116
+ "GenericIPAddressField",
117
+ "IPAddressField",
118
+ "ImageField",
119
+ "IntegerField",
120
+ "JSONField",
121
+ "ManyToManyField",
122
+ "NullBooleanField",
123
+ "OneToOneField",
113
124
  "PositiveBigIntegerField",
125
+ "PositiveIntegerField",
126
+ "PositiveSmallIntegerField",
127
+ "SlugField",
128
+ "SmallAutoField",
129
+ "SmallIntegerField",
130
+ "TextField",
131
+ "TimeField",
132
+ "URLField",
133
+ "UUIDField",
114
134
  ]
115
135
 
116
136
 
@@ -98,7 +98,7 @@ def get_access_token(email: str | None = None, password: str | None = None):
98
98
  )
99
99
  return auth_response.session.access_token
100
100
  finally:
101
- hub.auth.sign_out()
101
+ hub.auth.sign_out(options={"scope": "local"})
102
102
 
103
103
 
104
104
  def call_with_fallback_auth(
@@ -113,7 +113,7 @@ def call_with_fallback_auth(
113
113
  result = callable(**kwargs, client=client)
114
114
  finally:
115
115
  try:
116
- client.auth.sign_out()
116
+ client.auth.sign_out(options={"scope": "local"})
117
117
  except NameError:
118
118
  pass
119
119
  return result
@@ -137,7 +137,7 @@ def call_with_fallback_auth(
137
137
  raise e
138
138
  finally:
139
139
  try:
140
- client.auth.sign_out()
140
+ client.auth.sign_out(options={"scope": "local"})
141
141
  except NameError:
142
142
  pass
143
143
  return result
@@ -156,6 +156,9 @@ def call_with_fallback(
156
156
  if fallback_env:
157
157
  raise e
158
158
  finally:
159
- # in case there was sign in
160
- client.auth.sign_out()
159
+ try:
160
+ # in case there was sign in
161
+ client.auth.sign_out(options={"scope": "local"})
162
+ except NameError:
163
+ pass
161
164
  return result
@@ -161,8 +161,9 @@ class InstanceSettings:
161
161
  elif not mute_warning:
162
162
  logger.warning(
163
163
  f"none of the registered local storage locations were found in your environment: {local_records}"
164
- "\n❗ please register a new local storage location via `ln.settings.storage_local = local_root_path` "
165
- "and re-load/connect the instance"
164
+ )
165
+ logger.important(
166
+ "please register a new local storage location via `ln.settings.storage_local = local_root_path` and re-load/connect the instance"
166
167
  )
167
168
  return None
168
169
 
@@ -75,7 +75,9 @@ def load_bionty_sources(isettings: InstanceSettings):
75
75
 
76
76
  try:
77
77
  # need try except because of integer primary key migration
78
- active_records = Source.objects.filter(currently_used=True).all().values()
78
+ active_records = (
79
+ Source.objects.filter(currently_used=True).order_by("id").all().values()
80
+ )
79
81
  for kwargs in active_records:
80
82
  for db_field, base_col in RENAME.items():
81
83
  kwargs[base_col] = kwargs.pop(db_field)
@@ -32,7 +32,7 @@ def install(session: nox.Session, group: str) -> None:
32
32
  uv pip install --system --no-deps {no_deps_packages}
33
33
  """
34
34
  if group == "hub-cloud":
35
- cmds = schema_deps + "uv pip install --system ./laminhub/rest-hub"
35
+ cmds = schema_deps + "uv pip install --system ./laminhub/rest-hub line_profiler"
36
36
  elif group == "docs":
37
37
  cmds = (
38
38
  """uv pip install --system git+https://github.com/laminlabs/lnschema-core"""
@@ -51,7 +51,7 @@ uv pip install --system --no-deps {no_deps_packages}
51
51
 
52
52
  # above downgrades django, I don't understand why, try this
53
53
  if group == "hub-local":
54
- cmds += "\nuv pip install --system -e ./laminhub/rest-hub"
54
+ cmds += "\nuv pip install --system -e ./laminhub/rest-hub line_profiler"
55
55
 
56
56
  [run(session, line) for line in cmds.splitlines()]
57
57
 
@@ -18,6 +18,7 @@ dependencies = [
18
18
  "requests",
19
19
  "universal_pathlib==0.2.2", # is still experimental, need pinning
20
20
  "botocore<2.0.0",
21
+ "gotrue>=2.1.0", # for options in auth.sign_out
21
22
  "supabase==2.2.1",
22
23
  "psutil"
23
24
  ]
@@ -29,10 +30,10 @@ Home = "https://github.com/laminlabs/lamindb-setup"
29
30
  aws = [
30
31
  "urllib3<2", # for botocore, TODO: check that really required
31
32
  "aiobotocore[boto3]>=2.5.4,<3.0.0",
32
- "s3fs>=2023.12.2,<=2024.3.1"
33
+ "s3fs>=2023.12.2,<=2024.6.1"
33
34
  ]
34
35
  gcp = [
35
- "gcsfs>=2023.12.2,<=2024.3.1"
36
+ "gcsfs>=2023.12.2,<=2024.6.1"
36
37
  ]
37
38
  erdiagram = [
38
39
  "django-schema-graph",
@@ -201,6 +201,7 @@ def test_db_user(
201
201
  account_id=reader_settings._uuid,
202
202
  instance_id=instance_id,
203
203
  role="read",
204
+ schema_id=None,
204
205
  skip_insert_user_table=True,
205
206
  )
206
207
  # check that this was successful and can be read by the reader
File without changes
File without changes