sentry-devenv 1.14.5__py3-none-any.whl → 1.15.0__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.
- devenv/checks/credsStore.py +2 -3
- devenv/lib/venv.py +12 -7
- {sentry_devenv-1.14.5.dist-info → sentry_devenv-1.15.0.dist-info}/METADATA +2 -2
- {sentry_devenv-1.14.5.dist-info → sentry_devenv-1.15.0.dist-info}/RECORD +10 -8
- {sentry_devenv-1.14.5.dist-info → sentry_devenv-1.15.0.dist-info}/WHEEL +1 -1
- tests/checks/__init__.py +0 -0
- tests/checks/test_credStore.py +50 -0
- tests/lib/test_archive.py +5 -5
- {sentry_devenv-1.14.5.dist-info → sentry_devenv-1.15.0.dist-info}/entry_points.txt +0 -0
- {sentry_devenv-1.14.5.dist-info → sentry_devenv-1.15.0.dist-info}/top_level.txt +0 -0
devenv/checks/credsStore.py
CHANGED
|
@@ -19,9 +19,8 @@ def check() -> tuple[bool, str]:
|
|
|
19
19
|
with open(os.path.expanduser("~/.docker/config.json"), "rb") as f:
|
|
20
20
|
config = json.load(f)
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
):
|
|
22
|
+
store = config.get("credsStore", "")
|
|
23
|
+
if store and not shutil.which(f"docker-credential-{store}"):
|
|
25
24
|
return False, "credsStore requires nonexistent binary"
|
|
26
25
|
|
|
27
26
|
return True, ""
|
devenv/lib/venv.py
CHANGED
|
@@ -25,15 +25,20 @@ def get(
|
|
|
25
25
|
|
|
26
26
|
venv = cfg[f"venv.{name}"]
|
|
27
27
|
venv_dir = venv.get("path", f"{reporoot}/.venv-{name}")
|
|
28
|
-
|
|
29
|
-
if
|
|
28
|
+
editable_paths_s = venv.get("editable", None)
|
|
29
|
+
if editable_paths_s is not None:
|
|
30
30
|
editable_paths = tuple(
|
|
31
|
-
f"{reporoot}/{path}"
|
|
31
|
+
f"{reporoot}/{path}"
|
|
32
|
+
for path in editable_paths_s.strip().split("\n")
|
|
32
33
|
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
else:
|
|
35
|
+
editable_paths = None
|
|
36
|
+
|
|
37
|
+
bins_s = venv.get("bins", None)
|
|
38
|
+
if bins_s is not None:
|
|
39
|
+
bins = tuple(bins_s.strip().split("\n"))
|
|
40
|
+
else:
|
|
41
|
+
bins = None
|
|
37
42
|
|
|
38
43
|
return (
|
|
39
44
|
venv_dir,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: sentry_devenv
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.15.0
|
|
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=CkshQUvmVVblXdjARgWQKXSe7pwMjSMrPR3gDEesX5c,2402
|
|
15
15
|
devenv/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
devenv/checks/credsStore.py,sha256=
|
|
16
|
+
devenv/checks/credsStore.py,sha256=eUwtoQ8btFsM8Ir-Vla98MEQFQ5o-OyFu--CSnZr3uY,1149
|
|
17
17
|
devenv/checks/test.py,sha256=AvxoA2W5qTO2ZpoXmjScLiJxXD3Y_limYp5yTjGSZ9U,701
|
|
18
18
|
devenv/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
devenv/lib/archive.py,sha256=LlVETRsf3J53yY_8sjL4P8plLNEMKoS9G48kfoVoseA,4503
|
|
@@ -33,7 +33,7 @@ devenv/lib/proc.py,sha256=eU7DHIk_66wgkHRmdtKbBKZTa6q4tl9QJbrlnQOQCls,2743
|
|
|
33
33
|
devenv/lib/repository.py,sha256=cDCgcZ6lw0bcWC6DrcDp3tz_MWObmgAyFq39TeU7YHY,1966
|
|
34
34
|
devenv/lib/rosetta.py,sha256=Lm-tDFut86o6l-Y55d5kTacRHTwrv5MFEymQpy7Qihc,1170
|
|
35
35
|
devenv/lib/tenv.py,sha256=9-I-7wvJNqanaMEs39bheOfikVz3wgTKtArkeCsOz8I,3028
|
|
36
|
-
devenv/lib/venv.py,sha256=
|
|
36
|
+
devenv/lib/venv.py,sha256=VbV2IA3HTk5WABBpMQJvlizdknEQVz1SsLxlEBDOLkc,3186
|
|
37
37
|
devenv/lib_check/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
devenv/lib_check/brew.py,sha256=tId1IgItju-fulbmTXmmI2Oo_-q332rd1tUN5RSkTrs,544
|
|
39
39
|
devenv/lib_check/types.py,sha256=HIvuU3q27Izgm77jH6QX6gKMvgfunx05X4OEsJoqjP8,271
|
|
@@ -43,6 +43,8 @@ tests/test_main.py,sha256=S3IgdMIyUr1QWws_WQZcuXVEGU1GkOb3IiATUkfl9tc,657
|
|
|
43
43
|
tests/test_pythons.py,sha256=Nepff11shv18irF3EYzf3U6zsRMrpLeS8QfrGJ3bTME,723
|
|
44
44
|
tests/test_sync.py,sha256=ihCYFxscPwbVY_cnFyq2fvYUBc_SyB6gsElz334fmaw,871
|
|
45
45
|
tests/utils.py,sha256=Qr2RM5Vo-14mF8tPSJITiYuhGc6fU9rk-fChxW-lokk,291
|
|
46
|
+
tests/checks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
+
tests/checks/test_credStore.py,sha256=fvvKBx2vqbHDAfwxz77GPHO_gc8jawkqOpaDOob1dEs,1459
|
|
46
48
|
tests/doctor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
49
|
tests/doctor/test_attempt_fix.py,sha256=cGUv7-xRKWCizC9cNNqiCp7aa95k3nHUXvRFFuLfJ34,1075
|
|
48
50
|
tests/doctor/test_filter_failing_checks.py,sha256=5L5XdBSyeySwZtJeAR71lbktt3NxkJdUfncKBJPYdAc,1270
|
|
@@ -59,7 +61,7 @@ tests/doctor/devenv/checks/no_check.py,sha256=hcX2CNzB07U7r6KHbW71IvsW7UG-JsHcji
|
|
|
59
61
|
tests/doctor/devenv/checks/no_name.py,sha256=txJhaXiJjY4CUPONTX9G6J6RttTCJ-BupDmZT1sKoAc,167
|
|
60
62
|
tests/doctor/devenv/checks/no_tags.py,sha256=ATwlSsn5fe-OwNfgEDDa0HiBoOgkOGwkqIbQuDaghpk,161
|
|
61
63
|
tests/doctor/devenv/checks/passing_check.py,sha256=F-gW4ZEqXVBL5akMaR3Hcf3yuihm3jfxTY80-EqsbOg,307
|
|
62
|
-
tests/lib/test_archive.py,sha256=
|
|
64
|
+
tests/lib/test_archive.py,sha256=5FdCF8t64FewevL4P9PFojWS-a15z2I11TX0G1L_A-g,7944
|
|
63
65
|
tests/lib/test_brew.py,sha256=g2Sz-yg4-212qlsKg0vfHf604bQyRjUElsf3khvXrTQ,5711
|
|
64
66
|
tests/lib/test_direnv.py,sha256=GKpEbsHgaRZWevYrsa0oOGQFCsyllCLX1vGdg3igvAc,1551
|
|
65
67
|
tests/lib/test_fs.py,sha256=qhX9CQTTSht1f6ZJfmpsSFICTwPs--h_mLlS_1jnZQg,1670
|
|
@@ -67,8 +69,8 @@ tests/lib/test_github.py,sha256=IMEG2cmRaK_PMJprFE_ZMqPnZ0StwWqgznhhT_zVk3U,4526
|
|
|
67
69
|
tests/lib/test_proc.py,sha256=XH6OnxKPSSm3HvDjYHApputMKwgOE8lYqDuK2vK0Z0U,2626
|
|
68
70
|
tests/lib/test_repository.py,sha256=gUi1lkY7bha5WwZ5xcnENOlFYboVV8TFW1lCESvS0VA,787
|
|
69
71
|
tests/lib/test_venv.py,sha256=wscU7Enp8fK6o_2HgIT4WwDnvHbKwaKvJhNyJUrDNqk,3262
|
|
70
|
-
sentry_devenv-1.
|
|
71
|
-
sentry_devenv-1.
|
|
72
|
-
sentry_devenv-1.
|
|
73
|
-
sentry_devenv-1.
|
|
74
|
-
sentry_devenv-1.
|
|
72
|
+
sentry_devenv-1.15.0.dist-info/METADATA,sha256=kJJJ8eaE-2p2yKdrYPZVr0vr-mcDHZBn9Jrep6XQYBM,13429
|
|
73
|
+
sentry_devenv-1.15.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
74
|
+
sentry_devenv-1.15.0.dist-info/entry_points.txt,sha256=StsIuNugcoEU8jsPy6H9ECjzoDzOVKXl1vUaYTIGbzM,44
|
|
75
|
+
sentry_devenv-1.15.0.dist-info/top_level.txt,sha256=dOQExvIA0fj_EQjCrMTS7CCHNH7WZFHxEU0M7LlNcKQ,16
|
|
76
|
+
sentry_devenv-1.15.0.dist-info/RECORD,,
|
tests/checks/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os.path
|
|
4
|
+
import pathlib
|
|
5
|
+
import shutil
|
|
6
|
+
from collections.abc import Generator
|
|
7
|
+
from unittest import mock
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
from devenv.checks import credsStore
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.fixture
|
|
15
|
+
def fake_config(tmp_path: pathlib.Path) -> Generator[pathlib.Path]:
|
|
16
|
+
cfg = tmp_path.joinpath("config.json")
|
|
17
|
+
|
|
18
|
+
def new_expanduser(s: str) -> str:
|
|
19
|
+
assert s == "~/.docker/config.json"
|
|
20
|
+
return str(cfg)
|
|
21
|
+
|
|
22
|
+
with mock.patch.object(os.path, "expanduser", new_expanduser):
|
|
23
|
+
yield cfg
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def test_no_credsStore_ok(fake_config: pathlib.Path) -> None:
|
|
27
|
+
fake_config.write_text("{}")
|
|
28
|
+
assert credsStore.check() == (True, "")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def test_binary_ok(fake_config: pathlib.Path) -> None:
|
|
32
|
+
fake_config.write_text('{"credsStore": "example"}')
|
|
33
|
+
with mock.patch.object(shutil, "which", return_value="/fake/exe"):
|
|
34
|
+
assert credsStore.check() == (True, "")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@pytest.mark.parametrize("name", ("desktop", "osxkeychain"))
|
|
38
|
+
def test_binary_missing(fake_config: pathlib.Path, name: str) -> None:
|
|
39
|
+
fake_config.write_text(f'{{"credsStore": "{name}"}}')
|
|
40
|
+
with mock.patch.object(shutil, "which", return_value=None):
|
|
41
|
+
assert credsStore.check() == (
|
|
42
|
+
False,
|
|
43
|
+
"credsStore requires nonexistent binary",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_fix(fake_config: pathlib.Path) -> None:
|
|
48
|
+
fake_config.write_text('{"credsStore": "bad"}')
|
|
49
|
+
assert credsStore.fix() == (True, "")
|
|
50
|
+
assert fake_config.read_text() == "{}"
|
tests/lib/test_archive.py
CHANGED
|
@@ -20,7 +20,7 @@ def tar(tmp_path: pathlib.Path) -> pathlib.Path:
|
|
|
20
20
|
executable.write_text("hi")
|
|
21
21
|
|
|
22
22
|
tar = tmp_path / "tar"
|
|
23
|
-
with tarfile.open(tar, "w:
|
|
23
|
+
with tarfile.open(tar, "w:") as tarf:
|
|
24
24
|
tarf.add(executable, arcname="executable")
|
|
25
25
|
|
|
26
26
|
return tar
|
|
@@ -69,7 +69,7 @@ def tar2(tmp_path: pathlib.Path) -> pathlib.Path:
|
|
|
69
69
|
foo_v1_baz.mkdir()
|
|
70
70
|
|
|
71
71
|
tar = tmp_path / "tar"
|
|
72
|
-
with tarfile.open(tar, "w:
|
|
72
|
+
with tarfile.open(tar, "w:") as tarf:
|
|
73
73
|
tarf.add(foo, arcname="foo")
|
|
74
74
|
# foo
|
|
75
75
|
# foo/v1
|
|
@@ -95,7 +95,7 @@ def tar3(tmp_path: pathlib.Path) -> pathlib.Path:
|
|
|
95
95
|
foo_v1_foo.write_text("")
|
|
96
96
|
|
|
97
97
|
tar = tmp_path / "tar"
|
|
98
|
-
with tarfile.open(tar, "w:
|
|
98
|
+
with tarfile.open(tar, "w:") as tarf:
|
|
99
99
|
tarf.add(foo, arcname="foo")
|
|
100
100
|
# foo
|
|
101
101
|
# foo/bar
|
|
@@ -115,7 +115,7 @@ def tar4(tmp_path: pathlib.Path) -> pathlib.Path:
|
|
|
115
115
|
|
|
116
116
|
tar = tmp_path / "tar"
|
|
117
117
|
|
|
118
|
-
with tarfile.open(tar, "w:
|
|
118
|
+
with tarfile.open(tar, "w:") as tarf:
|
|
119
119
|
# note: arcname /foo doesn't work, it gets added as foo
|
|
120
120
|
tarf.add(foo, arcname="foo")
|
|
121
121
|
# /foo
|
|
@@ -139,7 +139,7 @@ def tar5(tmp_path: pathlib.Path) -> pathlib.Path:
|
|
|
139
139
|
|
|
140
140
|
tar = tmp_path / "tar"
|
|
141
141
|
|
|
142
|
-
with tarfile.open(tar, "w:
|
|
142
|
+
with tarfile.open(tar, "w:") as tarf:
|
|
143
143
|
tarf.add(foo, arcname="foo")
|
|
144
144
|
# foo
|
|
145
145
|
# foo/bar
|
|
File without changes
|
|
File without changes
|