sentry-devenv 1.22.1__py3-none-any.whl → 1.22.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.
@@ -32,6 +32,14 @@ def check() -> tuple[bool, str]:
32
32
  "cliPluginsExtraDirs exists, which overshadows the default plugin path",
33
33
  )
34
34
 
35
+ # Ensure the current context is set to colima
36
+ current_context = config.get("currentContext", "")
37
+ if current_context != "colima":
38
+ return (
39
+ False,
40
+ f"currentContext is '{current_context}', should be 'colima'",
41
+ )
42
+
35
43
  return True, ""
36
44
 
37
45
 
@@ -43,6 +51,7 @@ def fix() -> tuple[bool, str]:
43
51
 
44
52
  config.pop("credsStore", None)
45
53
  config.pop("cliPluginsExtraDirs", None)
54
+ config["currentContext"] = "colima"
46
55
 
47
56
  with open(os.path.expanduser("~/.docker/config.json"), "w") as f:
48
57
  json.dump(config, f)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry_devenv
3
- Version: 1.22.1
3
+ Version: 1.22.2
4
4
  Summary: Utilities for setting up a Sentry development environment
5
5
  Author-email: Joshua Li <joshua.li@sentry.io>, Ian Woodard <ian.woodard@sentry.io>, Buck Evan <buck.evan@sentry.io>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -13,7 +13,7 @@ devenv/pythons.py,sha256=ZcjBrkfmQEkiMP217VyTG48cyteJdYG_hoQ6oFKx_CU,1252
13
13
  devenv/sync.py,sha256=B9bvAuI7K-4SqcfHD4_zwKpozAnHWCNOL-IhVOcc3Zg,1254
14
14
  devenv/update.py,sha256=89ovkmUQ9WUNDpKr7GP56w2jTKFSQbfv3PYTBYhj5z4,2403
15
15
  devenv/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- devenv/checks/dockerConfig.py,sha256=5VExtcarjizPhR7OSdyWhkvzS6zY-6qiefxlwkexQuk,1623
16
+ devenv/checks/dockerConfig.py,sha256=l1xhsN0z3my27_DseXyBq_iVcGSgWKHi6suYOyBoWvo,1929
17
17
  devenv/checks/dockerDesktop.py,sha256=ynt8nNQ2DDT2rJDGZ-g7xxc4HErHJV_iqBqYHQtvA7Q,1343
18
18
  devenv/checks/limaDns.py,sha256=cHef2czdYYLvQqiM4bxiYtzYw4UVTIXJPwrGW2Kjpxo,1885
19
19
  devenv/checks/test.py,sha256=AvxoA2W5qTO2ZpoXmjScLiJxXD3Y_limYp5yTjGSZ9U,701
@@ -47,7 +47,7 @@ tests/test_pythons.py,sha256=Nepff11shv18irF3EYzf3U6zsRMrpLeS8QfrGJ3bTME,723
47
47
  tests/test_sync.py,sha256=ihCYFxscPwbVY_cnFyq2fvYUBc_SyB6gsElz334fmaw,871
48
48
  tests/utils.py,sha256=Qr2RM5Vo-14mF8tPSJITiYuhGc6fU9rk-fChxW-lokk,291
49
49
  tests/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- tests/checks/test_dockerConfig.py,sha256=wJQ1ADdG4HJCQyiTirUk5VsEAUfhlSDWCJfW_ylH5po,1702
50
+ tests/checks/test_dockerConfig.py,sha256=R9ed7DfYcCn37__98y3itCVG37BCDbJa0gLA9fQTp70,2978
51
51
  tests/doctor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  tests/doctor/test_attempt_fix.py,sha256=cGUv7-xRKWCizC9cNNqiCp7aa95k3nHUXvRFFuLfJ34,1075
53
53
  tests/doctor/test_filter_failing_checks.py,sha256=5L5XdBSyeySwZtJeAR71lbktt3NxkJdUfncKBJPYdAc,1270
@@ -72,8 +72,8 @@ tests/lib/test_github.py,sha256=IMEG2cmRaK_PMJprFE_ZMqPnZ0StwWqgznhhT_zVk3U,4526
72
72
  tests/lib/test_proc.py,sha256=XH6OnxKPSSm3HvDjYHApputMKwgOE8lYqDuK2vK0Z0U,2626
73
73
  tests/lib/test_repository.py,sha256=gUi1lkY7bha5WwZ5xcnENOlFYboVV8TFW1lCESvS0VA,787
74
74
  tests/lib/test_venv.py,sha256=3XGpINFBkn6Yq4OycsF-Ki4xMWAINt2g69uOHtkDU6k,3266
75
- sentry_devenv-1.22.1.dist-info/METADATA,sha256=UkT76m27R5FvrzZyuewNtQM5iJJSTUpGYF-93--GnYw,15500
76
- sentry_devenv-1.22.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
- sentry_devenv-1.22.1.dist-info/entry_points.txt,sha256=StsIuNugcoEU8jsPy6H9ECjzoDzOVKXl1vUaYTIGbzM,44
78
- sentry_devenv-1.22.1.dist-info/top_level.txt,sha256=dOQExvIA0fj_EQjCrMTS7CCHNH7WZFHxEU0M7LlNcKQ,16
79
- sentry_devenv-1.22.1.dist-info/RECORD,,
75
+ sentry_devenv-1.22.2.dist-info/METADATA,sha256=o0O5ZZOakaOZ_olZE1m_EjgPFJE-OmiZmGBQQiNqHQs,15500
76
+ sentry_devenv-1.22.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
77
+ sentry_devenv-1.22.2.dist-info/entry_points.txt,sha256=StsIuNugcoEU8jsPy6H9ECjzoDzOVKXl1vUaYTIGbzM,44
78
+ sentry_devenv-1.22.2.dist-info/top_level.txt,sha256=dOQExvIA0fj_EQjCrMTS7CCHNH7WZFHxEU0M7LlNcKQ,16
79
+ sentry_devenv-1.22.2.dist-info/RECORD,,
@@ -24,12 +24,14 @@ def fake_config(tmp_path: pathlib.Path) -> Generator[pathlib.Path]:
24
24
 
25
25
 
26
26
  def test_no_credsStore_ok(fake_config: pathlib.Path) -> None:
27
- fake_config.write_text("{}")
27
+ fake_config.write_text('{"currentContext": "colima"}')
28
28
  assert dockerConfig.check() == (True, "")
29
29
 
30
30
 
31
31
  def test_binary_ok(fake_config: pathlib.Path) -> None:
32
- fake_config.write_text('{"credsStore": "example"}')
32
+ fake_config.write_text(
33
+ '{"credsStore": "example", "currentContext": "colima"}'
34
+ )
33
35
  with mock.patch.object(shutil, "which", return_value="/fake/exe"):
34
36
  assert dockerConfig.check() == (True, "")
35
37
 
@@ -47,10 +49,45 @@ def test_binary_missing(fake_config: pathlib.Path, name: str) -> None:
47
49
  def test_fix_credsStore(fake_config: pathlib.Path) -> None:
48
50
  fake_config.write_text('{"credsStore": "bad"}')
49
51
  assert dockerConfig.fix() == (True, "")
50
- assert fake_config.read_text() == "{}"
52
+ assert fake_config.read_text() == '{"currentContext": "colima"}'
51
53
 
52
54
 
53
55
  def test_fix_cliPluginsExtraDirs(fake_config: pathlib.Path) -> None:
54
56
  fake_config.write_text('{"cliPluginsExtraDirs": ["foo/"]}')
55
57
  assert dockerConfig.fix() == (True, "")
56
- assert fake_config.read_text() == "{}"
58
+ assert fake_config.read_text() == '{"currentContext": "colima"}'
59
+
60
+
61
+ def test_currentContext_missing(fake_config: pathlib.Path) -> None:
62
+ fake_config.write_text('{"auths": {}}')
63
+ assert dockerConfig.check() == (
64
+ False,
65
+ "currentContext is '', should be 'colima'",
66
+ )
67
+
68
+
69
+ def test_currentContext_wrong(fake_config: pathlib.Path) -> None:
70
+ fake_config.write_text('{"currentContext": "desktop"}')
71
+ assert dockerConfig.check() == (
72
+ False,
73
+ "currentContext is 'desktop', should be 'colima'",
74
+ )
75
+
76
+
77
+ def test_currentContext_correct(fake_config: pathlib.Path) -> None:
78
+ fake_config.write_text('{"currentContext": "colima"}')
79
+ assert dockerConfig.check() == (True, "")
80
+
81
+
82
+ def test_fix_currentContext_missing(fake_config: pathlib.Path) -> None:
83
+ fake_config.write_text('{"auths": {}}')
84
+ assert dockerConfig.fix() == (True, "")
85
+ assert (
86
+ fake_config.read_text() == '{"auths": {}, "currentContext": "colima"}'
87
+ )
88
+
89
+
90
+ def test_fix_currentContext_wrong(fake_config: pathlib.Path) -> None:
91
+ fake_config.write_text('{"currentContext": "docker-desktop"}')
92
+ assert dockerConfig.fix() == (True, "")
93
+ assert fake_config.read_text() == '{"currentContext": "colima"}'