lamindb_setup 1.10.1__py3-none-any.whl → 1.10.2__py3-none-any.whl

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/__init__.py CHANGED
@@ -35,7 +35,7 @@ Modules & settings:
35
35
 
36
36
  """
37
37
 
38
- __version__ = "1.10.1" # denote a release candidate for 0.1.0 with 0.1rc1
38
+ __version__ = "1.10.2" # denote a release candidate for 0.1.0 with 0.1rc1
39
39
 
40
40
  import os
41
41
 
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import importlib
4
4
  import os
5
5
  import sys
6
+ import types
6
7
  from typing import TYPE_CHECKING, Any
7
8
  from uuid import UUID
8
9
 
@@ -184,24 +185,26 @@ def _connect_instance(
184
185
  def reset_django_module_variables():
185
186
  # This function updates all module-level references to Django classes
186
187
  # But it will fail to update function level references
188
+ # This is not a problem unless for the function that calls ln.connect() itself
187
189
  # So, if a user has
190
+ #
188
191
  # def my_function():
189
192
  # import lamindb as ln
190
- # ...
193
+ # ln.connect(...)
191
194
  #
192
- # Then it will **not** work and the `ln` variable will become stale and hold a reference
195
+ # Then it will **not** work and the `ln` variable becomes stale and hold a reference
193
196
  # to the old classes
194
- # There doesn't seem to be an easy way to fix this problem
195
-
197
+ # Other functions that dynamically import are no problem because the variables
198
+ # are automatically refreshed when the function runs the next time after ln.connect() was called
196
199
  logger.important_hint("resetting django module variables")
197
200
 
198
- import types
199
-
201
+ # django.apps needs to be a local import to refresh variables
200
202
  from django.apps import apps
201
203
 
202
204
  app_names = {app.name for app in apps.get_app_configs()}
203
-
204
- for name, module in sys.modules.items():
205
+ # always copy before iterations over sys.modules
206
+ # see https://docs.python.org/3/library/sys.html#sys.modules
207
+ for name, module in sys.modules.copy().items():
205
208
  if (
206
209
  module is not None
207
210
  and (not name.startswith("__") or name == "__main__")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb_setup
3
- Version: 1.10.1
3
+ Version: 1.10.2
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10
@@ -1,8 +1,8 @@
1
- lamindb_setup/__init__.py,sha256=f4yuL2G9SCvHZrn-uJT2LGRITfCtR6_nD63gAW-eaBI,2783
1
+ lamindb_setup/__init__.py,sha256=X3c4WiIMGBIUrnNgq0NYa6vEZbdSPENtF4bbr2kHuwc,2783
2
2
  lamindb_setup/_cache.py,sha256=pGvDNVHGx4HWr_6w5ajqEJOdysmaGc6F221qFnXkT-k,2747
3
3
  lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
4
4
  lamindb_setup/_check_setup.py,sha256=ToKMxsUq8dQBQh8baOrNVlSb1iC8h4zTg5dV8wMu0W4,6760
5
- lamindb_setup/_connect_instance.py,sha256=MPImCVAV0sZFX5s7muiR5lT2nqU5Z_j7LLo7apMZEZY,17143
5
+ lamindb_setup/_connect_instance.py,sha256=6pgE_8Kv8ZVytXzN6Qp5ZlOtMtqE93cIdSkdA3Ey8ko,17545
6
6
  lamindb_setup/_delete.py,sha256=4kS-_nQrV5xMvZE3BGCNEEGCboyGmqqDMXlckF0GxSk,5780
7
7
  lamindb_setup/_disconnect.py,sha256=FT8EpCm5XXDdhDH7QtAnkO3KPatq2HqT9VXGNjgJDbk,1232
8
8
  lamindb_setup/_django.py,sha256=uIQflpkp8l3axyPaKURlk3kacgpElVP5KOKmFxYSMGk,1454
@@ -44,7 +44,7 @@ lamindb_setup/core/exceptions.py,sha256=qjMzqy_uzPA7mCOdnoWnS_fdA6OWbdZGftz-YYpl
44
44
  lamindb_setup/core/hashing.py,sha256=Y8Uc5uSGTfU6L2R_gb5w8DdHhGRog7RnkK-e9FEMjPY,3680
45
45
  lamindb_setup/core/types.py,sha256=T7NwspfRHgIIpYsXDcApks8jkOlGeGRW-YbVLB7jNIo,67
46
46
  lamindb_setup/core/upath.py,sha256=-Wxct7lYOLVzUGv3ynqq0zLcRSAGWbvs-NqrZL0Aqy4,35579
47
- lamindb_setup-1.10.1.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
48
- lamindb_setup-1.10.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
49
- lamindb_setup-1.10.1.dist-info/METADATA,sha256=O4pmYo1z2JRRyPtjeySj76t-9cwPzsmM-vmjFiBlkPI,1804
50
- lamindb_setup-1.10.1.dist-info/RECORD,,
47
+ lamindb_setup-1.10.2.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
48
+ lamindb_setup-1.10.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
49
+ lamindb_setup-1.10.2.dist-info/METADATA,sha256=B90EP2olTts5waIXLN5nLvIBqWnhY_FxeoMX9yLOnwk,1804
50
+ lamindb_setup-1.10.2.dist-info/RECORD,,