fmu-settings 0.3.0__py3-none-any.whl → 0.3.1__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.
Potentially problematic release.
This version of fmu-settings might be problematic. Click here for more details.
- fmu/settings/_resources/lock_manager.py +13 -3
- fmu/settings/_version.py +2 -2
- {fmu_settings-0.3.0.dist-info → fmu_settings-0.3.1.dist-info}/METADATA +1 -1
- {fmu_settings-0.3.0.dist-info → fmu_settings-0.3.1.dist-info}/RECORD +7 -7
- {fmu_settings-0.3.0.dist-info → fmu_settings-0.3.1.dist-info}/WHEEL +0 -0
- {fmu_settings-0.3.0.dist-info → fmu_settings-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {fmu_settings-0.3.0.dist-info → fmu_settings-0.3.1.dist-info}/top_level.txt +0 -0
|
@@ -153,7 +153,17 @@ class LockManager(PydanticResourceManager[LockInfo]):
|
|
|
153
153
|
temp_path.unlink()
|
|
154
154
|
|
|
155
155
|
def is_locked(self: Self) -> bool:
|
|
156
|
-
"""Returns whether or not the lock is
|
|
156
|
+
"""Returns whether or not the lock is locked by anyone.
|
|
157
|
+
|
|
158
|
+
This does a force load on the lock file.
|
|
159
|
+
"""
|
|
160
|
+
lock_info = self._safe_load(force=True)
|
|
161
|
+
if not lock_info:
|
|
162
|
+
return False
|
|
163
|
+
return time.time() < lock_info.expires_at
|
|
164
|
+
|
|
165
|
+
def is_acquired(self: Self) -> bool:
|
|
166
|
+
"""Returns whether or not the lock is currently acquired by this instance."""
|
|
157
167
|
if self._cache is None or self._acquired_at is None:
|
|
158
168
|
return False
|
|
159
169
|
return self._is_mine(self._cache) and not self._is_stale()
|
|
@@ -219,13 +229,13 @@ class LockManager(PydanticResourceManager[LockInfo]):
|
|
|
219
229
|
and lock_info.acquired_at == self._acquired_at
|
|
220
230
|
)
|
|
221
231
|
|
|
222
|
-
def _safe_load(self: Self) -> LockInfo | None:
|
|
232
|
+
def _safe_load(self: Self, force: bool = False) -> LockInfo | None:
|
|
223
233
|
"""Load lock info, returning None if corrupted.
|
|
224
234
|
|
|
225
235
|
Because this file does not exist in a static state, wrap around loading it.
|
|
226
236
|
"""
|
|
227
237
|
try:
|
|
228
|
-
return self.load()
|
|
238
|
+
return self.load(force=force)
|
|
229
239
|
except Exception:
|
|
230
240
|
return None
|
|
231
241
|
|
fmu/settings/_version.py
CHANGED
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 3,
|
|
31
|
+
__version__ = version = '0.3.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 3, 1)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -3,12 +3,12 @@ fmu/settings/__init__.py,sha256=CkEE7al_uBCQO1lxBKN5LzyCwzzH5Aq6kkEIR7f-zTw,336
|
|
|
3
3
|
fmu/settings/_fmu_dir.py,sha256=Br_hcfAXshiuDyWqG_qx5VXFpsCBJO1XDMPzdxxesoE,10684
|
|
4
4
|
fmu/settings/_init.py,sha256=5CT7tV2XHz5wuLh97XozyLiKpwogrsfjpxm2dpn7KWE,4097
|
|
5
5
|
fmu/settings/_logging.py,sha256=nEdmZlNCBsB1GfDmFMKCjZmeuRp3CRlbz1EYUemc95Y,1104
|
|
6
|
-
fmu/settings/_version.py,sha256=
|
|
6
|
+
fmu/settings/_version.py,sha256=gGLpQUQx-ty9SEy9PYw9OgJWWzJLBnCpfJOfzL7SjlI,704
|
|
7
7
|
fmu/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
fmu/settings/types.py,sha256=aeXEsznBTT1YRRY_LSRqK1j2gmMmyLYYTGYl3a9fweU,513
|
|
9
9
|
fmu/settings/_resources/__init__.py,sha256=LHYR_F7lNGdv8N6R3cEwds5CJQpkOthXFqsEs24vgF8,118
|
|
10
10
|
fmu/settings/_resources/config_managers.py,sha256=IjOtS2lSU55GE_TWqHjbBPAzE8xQyVBvpHcfm0hTSnI,6822
|
|
11
|
-
fmu/settings/_resources/lock_manager.py,sha256=
|
|
11
|
+
fmu/settings/_resources/lock_manager.py,sha256=_xzSJNF_qcpKpo8AxMfEgOhPxKXl3fZ2lRi0_y2eUEg,9206
|
|
12
12
|
fmu/settings/_resources/pydantic_resource_manager.py,sha256=9zFcOUJKeapxbYvgerf3t2_9pL5acFU2rknri67pXt0,3131
|
|
13
13
|
fmu/settings/models/__init__.py,sha256=lRlXgl55ba2upmDzdvzx8N30JMq2Osnm8aa_xxTZn8A,112
|
|
14
14
|
fmu/settings/models/_enums.py,sha256=SQUZ-2mQcTx4F0oefPFfuQzMKsKTSFSB-wq_CH7TBRE,734
|
|
@@ -16,8 +16,8 @@ fmu/settings/models/_mappings.py,sha256=Z4Ex7MtmajBr6FjaNzmwDRwtJlaZZ8YKh9NDmZHR
|
|
|
16
16
|
fmu/settings/models/lock_info.py,sha256=-oHDF9v9bDLCoFvEg4S6XXYLeo19zRAZ8HynCv75VWg,711
|
|
17
17
|
fmu/settings/models/project_config.py,sha256=pxb54JmpXNMVAFUu_yJ89dNrYEk6hrPuFfFUpf84Jh0,1099
|
|
18
18
|
fmu/settings/models/user_config.py,sha256=dWFTcZY6UnEgNTuGqB-izraJ657PecsW0e0Nt9GBDhI,2666
|
|
19
|
-
fmu_settings-0.3.
|
|
20
|
-
fmu_settings-0.3.
|
|
21
|
-
fmu_settings-0.3.
|
|
22
|
-
fmu_settings-0.3.
|
|
23
|
-
fmu_settings-0.3.
|
|
19
|
+
fmu_settings-0.3.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
20
|
+
fmu_settings-0.3.1.dist-info/METADATA,sha256=4reIMuluyZnwiu3CuLCdYXCAJz7hPu4i-_R3IbJwi08,2024
|
|
21
|
+
fmu_settings-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
22
|
+
fmu_settings-0.3.1.dist-info/top_level.txt,sha256=Z-FIY3pxn0UK2Wxi9IJ7fKoLSraaxuNGi1eokiE0ShM,4
|
|
23
|
+
fmu_settings-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|