fmu-settings 0.5.2__tar.gz → 0.5.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.

Potentially problematic release.


This version of fmu-settings might be problematic. Click here for more details.

Files changed (45) hide show
  1. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/PKG-INFO +1 -1
  2. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_resources/lock_manager.py +5 -1
  3. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_version.py +3 -3
  4. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu_settings.egg-info/PKG-INFO +1 -1
  5. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_resources/test_lock_manager.py +15 -23
  6. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.coveragerc +0 -0
  7. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.github/pull_request_template.md +0 -0
  8. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.github/workflows/ci.yml +0 -0
  9. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.github/workflows/codeql.yml +0 -0
  10. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.github/workflows/publish.yml +0 -0
  11. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/.gitignore +0 -0
  12. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/CONTRIBUTING.md +0 -0
  13. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/LICENSE +0 -0
  14. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/README.md +0 -0
  15. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/SECURITY.md +0 -0
  16. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/pyproject.toml +0 -0
  17. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/setup.cfg +0 -0
  18. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/__init__.py +0 -0
  19. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/__init__.py +0 -0
  20. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_fmu_dir.py +0 -0
  21. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_global_config.py +0 -0
  22. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_init.py +0 -0
  23. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_logging.py +0 -0
  24. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_resources/__init__.py +0 -0
  25. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_resources/config_managers.py +0 -0
  26. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/_resources/pydantic_resource_manager.py +0 -0
  27. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/__init__.py +0 -0
  28. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/_enums.py +0 -0
  29. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/_mappings.py +0 -0
  30. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/lock_info.py +0 -0
  31. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/project_config.py +0 -0
  32. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/models/user_config.py +0 -0
  33. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/py.typed +0 -0
  34. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu/settings/types.py +0 -0
  35. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu_settings.egg-info/SOURCES.txt +0 -0
  36. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu_settings.egg-info/dependency_links.txt +0 -0
  37. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu_settings.egg-info/requires.txt +0 -0
  38. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/src/fmu_settings.egg-info/top_level.txt +0 -0
  39. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/conftest.py +0 -0
  40. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_fmu_dir.py +0 -0
  41. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_global_config.py +0 -0
  42. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_init.py +0 -0
  43. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_resources/test_project_config.py +0 -0
  44. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_resources/test_resource_managers.py +0 -0
  45. {fmu_settings-0.5.2 → fmu_settings-0.5.3}/tests/test_resources/test_user_config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-settings
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: A library for managing FMU settings
5
5
  Author-email: Equinor <fg-fmu_atlas@equinor.com>
6
6
  License: GPL-3.0
@@ -32,6 +32,10 @@ class LockError(Exception):
32
32
  """Raised when the lock cannot be acquired."""
33
33
 
34
34
 
35
+ class LockNotFoundError(FileNotFoundError):
36
+ """Raised when the lock cannot be found."""
37
+
38
+
35
39
  class LockManager(PydanticResourceManager[LockInfo]):
36
40
  """Manages the .lock file."""
37
41
 
@@ -196,7 +200,7 @@ class LockManager(PydanticResourceManager[LockInfo]):
196
200
  if not self.exists:
197
201
  if self.is_acquired():
198
202
  self.release()
199
- raise LockError("Cannot refresh: lock file does not exist")
203
+ raise LockNotFoundError("Cannot refresh: lock file does not exist")
200
204
 
201
205
  lock_info = self._safe_load()
202
206
  if not lock_info or not self._is_mine(lock_info):
@@ -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.5.2'
32
- __version_tuple__ = version_tuple = (0, 5, 2)
31
+ __version__ = version = '0.5.3'
32
+ __version_tuple__ = version_tuple = (0, 5, 3)
33
33
 
34
- __commit_id__ = commit_id = 'g4490dbb9d'
34
+ __commit_id__ = commit_id = 'g7953e1c0f'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmu-settings
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: A library for managing FMU settings
5
5
  Author-email: Equinor <fg-fmu_atlas@equinor.com>
6
6
  License: GPL-3.0
@@ -19,6 +19,7 @@ from fmu.settings._resources.lock_manager import (
19
19
  DEFAULT_LOCK_TIMEOUT,
20
20
  LockError,
21
21
  LockManager,
22
+ LockNotFoundError,
22
23
  )
23
24
  from fmu.settings.models.lock_info import LockInfo
24
25
 
@@ -493,15 +494,21 @@ def test_refresh_works_as_expected(
493
494
  def test_refresh_without_lock_file(
494
495
  fmu_dir: ProjectFMUDirectory, monkeypatch: MonkeyPatch
495
496
  ) -> None:
496
- """Tests refresh when lock file is not present."""
497
- lock = LockManager(fmu_dir)
498
- with pytest.raises(LockError, match="does not exist"):
499
- lock.refresh()
497
+ """Tests that if a user deletes anothers lock it's invalidated on a refresh."""
498
+ with pytest.raises(LockNotFoundError, match="does not exist"):
499
+ fmu_dir._lock.refresh()
500
500
 
501
- lock.acquire()
502
- lock.path.unlink() # It was deleted or something.
503
- with pytest.raises(LockError, match="does not exist"):
504
- lock.refresh()
501
+ fmu_dir._lock.acquire()
502
+ assert fmu_dir._lock.is_acquired() is True
503
+
504
+ # Someone deletes the lock
505
+ fmu_dir._lock.path.unlink()
506
+
507
+ with pytest.raises(
508
+ LockNotFoundError, match="Cannot refresh: lock file does not exist"
509
+ ):
510
+ fmu_dir._lock.refresh()
511
+ assert fmu_dir._lock.is_acquired() is False
505
512
 
506
513
 
507
514
  def test_refresh_without_owning_lock(
@@ -649,18 +656,3 @@ def test_ensure_can_write_foreign_lock(fmu_dir: ProjectFMUDirectory) -> None:
649
656
  pytest.raises(PermissionError, match="Cannot write to .fmu directory"),
650
657
  ):
651
658
  lock.ensure_can_write()
652
-
653
-
654
- def test_manual_delete_invalidates_lock_file_on_refresh(
655
- fmu_dir: ProjectFMUDirectory,
656
- ) -> None:
657
- """Tests that if a user deletes anothers lock it's invalidated on a refresh."""
658
- fmu_dir._lock.acquire()
659
- assert fmu_dir._lock.is_acquired() is True
660
-
661
- # Someone deletes the lock
662
- fmu_dir._lock.path.unlink()
663
-
664
- with pytest.raises(LockError, match="Cannot refresh: lock file does not exist"):
665
- fmu_dir._lock.refresh()
666
- assert fmu_dir._lock.is_acquired() is False
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes