sentry-devenv 1.26.1__tar.gz → 1.27.0__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.
Files changed (86) hide show
  1. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/PKG-INFO +2 -2
  2. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/README.md +1 -1
  3. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/bootstrap.py +15 -5
  4. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/colimaSsh.py +1 -1
  5. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/diskfree.py +1 -1
  6. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/dockerConfig.py +2 -2
  7. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/dockerDesktop.py +3 -3
  8. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/limaDns.py +1 -1
  9. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/constants.py +3 -0
  10. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/doctor.py +24 -5
  11. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/fetch.py +23 -42
  12. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/colima.py +0 -2
  13. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/docker.py +0 -4
  14. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/limactl.py +1 -8
  15. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/update.py +9 -4
  16. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/pyproject.toml +1 -1
  17. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/PKG-INFO +2 -2
  18. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/test_load_checks.py +33 -6
  19. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/ci/integration/repo/devenv/sync.py +0 -0
  20. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/__init__.py +0 -0
  21. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/__main__.py +0 -0
  22. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/checks/__init__.py +0 -0
  23. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/colima.py +0 -0
  24. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/__init__.py +0 -0
  25. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/archive.py +0 -0
  26. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/brew.py +0 -0
  27. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/config.py +0 -0
  28. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/context.py +0 -0
  29. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/direnv.py +0 -0
  30. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/fs.py +0 -0
  31. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/gcloud.py +0 -0
  32. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/github.py +0 -0
  33. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/modules.py +0 -0
  34. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/node.py +0 -0
  35. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/proc.py +0 -0
  36. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/repository.py +0 -0
  37. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/rosetta.py +0 -0
  38. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/tenv.py +0 -0
  39. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/uv.py +0 -0
  40. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib/venv.py +0 -0
  41. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib_check/__init__.py +0 -0
  42. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib_check/brew.py +0 -0
  43. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/lib_check/types.py +0 -0
  44. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/main.py +0 -0
  45. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/pin_gha.py +0 -0
  46. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/py.typed +0 -0
  47. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/pythons.py +0 -0
  48. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/devenv/sync.py +0 -0
  49. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/SOURCES.txt +0 -0
  50. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/dependency_links.txt +0 -0
  51. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/entry_points.txt +0 -0
  52. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/requires.txt +0 -0
  53. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/sentry_devenv.egg-info/top_level.txt +0 -0
  54. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/setup.cfg +0 -0
  55. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/__init__.py +0 -0
  56. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/checks/__init__.py +0 -0
  57. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/checks/test_dockerConfig.py +0 -0
  58. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/conftest.py +0 -0
  59. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/__init__.py +0 -0
  60. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/bad_check.py +0 -0
  61. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/bad_fix.py +0 -0
  62. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/broken_check.py +0 -0
  63. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/broken_fix.py +0 -0
  64. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/failing_check.py +0 -0
  65. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/failing_check_with_msg.py +0 -0
  66. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/no_check.py +0 -0
  67. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/no_name.py +0 -0
  68. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/no_tags.py +0 -0
  69. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/devenv/checks/passing_check.py +0 -0
  70. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/test_attempt_fix.py +0 -0
  71. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/test_filter_failing_checks.py +0 -0
  72. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/test_prompt_for_fix.py +0 -0
  73. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/doctor/test_run_checks.py +0 -0
  74. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_archive.py +0 -0
  75. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_brew.py +0 -0
  76. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_direnv.py +0 -0
  77. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_fs.py +0 -0
  78. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_github.py +0 -0
  79. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_node.py +0 -0
  80. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_proc.py +0 -0
  81. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_repository.py +0 -0
  82. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/lib/test_venv.py +0 -0
  83. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/test_main.py +0 -0
  84. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/test_pythons.py +0 -0
  85. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/test_sync.py +0 -0
  86. {sentry_devenv-1.26.1 → sentry_devenv-1.27.0}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry_devenv
3
- Version: 1.26.1
3
+ Version: 1.27.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
@@ -98,7 +98,7 @@ Everything devenv needs is in `~/.local/share/sentry-devenv`.
98
98
  - `direnv`
99
99
  - we currently rely on direnv and a minimal [`[reporoot]/.envrc`](#direnv) to add `[reporoot]/.devenv/bin` to PATH
100
100
  - see [examples](#examples) for .envrc suggestions
101
- - global tools: `docker` (cli), `colima`
101
+ - global tools (macos only; you are otherwise expected to install docker yourself): `docker` (cli), `colima`
102
102
 
103
103
 
104
104
  ### runtime
@@ -85,7 +85,7 @@ Everything devenv needs is in `~/.local/share/sentry-devenv`.
85
85
  - `direnv`
86
86
  - we currently rely on direnv and a minimal [`[reporoot]/.envrc`](#direnv) to add `[reporoot]/.devenv/bin` to PATH
87
87
  - see [examples](#examples) for .envrc suggestions
88
- - global tools: `docker` (cli), `colima`
88
+ - global tools (macos only; you are otherwise expected to install docker yourself): `docker` (cli), `colima`
89
89
 
90
90
 
91
91
  ### runtime
@@ -54,9 +54,15 @@ def main(context: Context, argv: Sequence[str] | None = None) -> ExitCode:
54
54
  except RuntimeError:
55
55
  return "Failed to find git. Run xcode-select --install, then re-run bootstrap when done."
56
56
 
57
+ if constants.LINUX and not (
58
+ shutil.which("docker") and shutil.which("dockerd")
59
+ ):
60
+ raise SystemExit("docker engine not installed; required on linux")
61
+
57
62
  # even though this is called before colima starts,
58
63
  # better to try and potentially (although unlikely) fail earlier rather than later
59
- rosetta.ensure()
64
+ if constants.DARWIN:
65
+ rosetta.ensure()
60
66
 
61
67
  github.add_to_known_hosts()
62
68
 
@@ -103,11 +109,15 @@ Updating global tools (at {constants.root}/bin).
103
109
  """
104
110
  )
105
111
  os.makedirs(f"{constants.root}/bin", exist_ok=True)
106
- brew.install()
107
- docker.install_global()
112
+
113
+ if constants.DARWIN:
114
+ # we only install brew and colima-related stuff on macos
115
+ brew.install()
116
+ docker.install_global()
117
+ colima.install_global()
118
+ limactl.install_global()
119
+
108
120
  direnv.install()
109
- colima.install_global()
110
- limactl.install_global()
111
121
 
112
122
  os.makedirs(context["code_root"], exist_ok=True)
113
123
 
@@ -8,7 +8,7 @@ from devenv.lib import proc
8
8
  from devenv.lib_check.types import checker
9
9
  from devenv.lib_check.types import fixer
10
10
 
11
- tags: set[str] = {"builtin"}
11
+ tags: set[str] = {"builtin", "colima"}
12
12
  name = "colima ssh credentials should only be owner rw"
13
13
 
14
14
 
@@ -18,7 +18,7 @@ def check() -> tuple[bool, str]:
18
18
  return (
19
19
  False,
20
20
  f"You have less than 10 GiB disk free ({disk_gib_free} GiB free). "
21
- "You might start to encounter various problems when using colima.",
21
+ "You might start to encounter various problems when using docker.",
22
22
  )
23
23
 
24
24
  return True, ""
@@ -7,8 +7,8 @@ import shutil
7
7
  from devenv.lib_check.types import checker
8
8
  from devenv.lib_check.types import fixer
9
9
 
10
- tags: set[str] = {"builtin"}
11
- name = "correct docker configuration"
10
+ tags: set[str] = {"builtin", "colima"}
11
+ name = "correct docker configuration for colima"
12
12
 
13
13
 
14
14
  @checker
@@ -6,8 +6,8 @@ from devenv.lib import proc
6
6
  from devenv.lib_check.types import checker
7
7
  from devenv.lib_check.types import fixer
8
8
 
9
- tags: set[str] = {"builtin"}
10
- name = "docker desktop shouldn't be running"
9
+ tags: set[str] = {"builtin", "colima"}
10
+ name = "docker desktop shouldn't be running if you're trying to use colima"
11
11
 
12
12
 
13
13
  def docker_desktop_is_running() -> bool:
@@ -20,7 +20,7 @@ def check() -> tuple[bool, str]:
20
20
  if docker_desktop_is_running():
21
21
  return (
22
22
  False,
23
- "Docker Desktop is running. We don't support it, and it conflicts with colima.",
23
+ "Docker Desktop is running. It cannot be running at the same time as colima.",
24
24
  )
25
25
 
26
26
  return True, ""
@@ -7,7 +7,7 @@ from devenv.lib import proc
7
7
  from devenv.lib_check.types import checker
8
8
  from devenv.lib_check.types import fixer
9
9
 
10
- tags: set[str] = {"builtin"}
10
+ tags: set[str] = {"builtin", "colima"}
11
11
  name = "colima's DNS isn't working"
12
12
 
13
13
 
@@ -4,6 +4,7 @@ import importlib.metadata
4
4
  import os
5
5
  import platform
6
6
  import pwd
7
+ import shutil
7
8
  import typing
8
9
 
9
10
  troubleshooting_help = """\
@@ -27,6 +28,8 @@ CI = os.getenv("CI")
27
28
  SYSTEM = platform.system().lower()
28
29
  MACHINE = platform.machine()
29
30
  DARWIN = SYSTEM == "darwin"
31
+ # we only support apt-based linuxes
32
+ LINUX = shutil.which("dpkg") is not None
30
33
  INTEL_MAC = DARWIN and (MACHINE == "x86_64")
31
34
  SHELL_UNSET = "(SHELL unset)"
32
35
  DEBUG = os.getenv("SNTY_DEVENV_DEBUG", os.getenv("DEBUG", ""))
@@ -14,6 +14,7 @@ from typing import Dict
14
14
  from typing import List
15
15
 
16
16
  import devenv.checks
17
+ from devenv import constants
17
18
  from devenv.lib.context import Context
18
19
  from devenv.lib.modules import DevModuleInfo
19
20
  from devenv.lib.repository import Repository
@@ -78,7 +79,9 @@ class Check:
78
79
  super().__init__()
79
80
 
80
81
 
81
- def load_checks(repo: Repository, match_tags: set[str]) -> List[Check]:
82
+ def load_checks(
83
+ repo: Repository, match_tags: set[str], exclude_tags: set[str]
84
+ ) -> List[Check]:
82
85
  """
83
86
  Load all checks from the checks directory.
84
87
  Optionally filter by tags.
@@ -104,11 +107,15 @@ def load_checks(repo: Repository, match_tags: set[str]) -> List[Check]:
104
107
  continue
105
108
  if match_tags and not check.tags.issuperset(match_tags):
106
109
  continue
110
+ if check.tags & exclude_tags:
111
+ continue
107
112
  checks.append(check)
108
113
  return checks
109
114
 
110
115
 
111
- def load_builtin_checks(match_tags: set[str]) -> List[Check]:
116
+ def load_builtin_checks(
117
+ match_tags: set[str], exclude_tags: set[str]
118
+ ) -> List[Check]:
112
119
  """
113
120
  Loads builtin checks.
114
121
  Optionally filter by tags.
@@ -126,6 +133,8 @@ def load_builtin_checks(match_tags: set[str]) -> List[Check]:
126
133
  continue
127
134
  if match_tags and not check.tags.issuperset(match_tags):
128
135
  continue
136
+ if check.tags & exclude_tags:
137
+ continue
129
138
  checks.append(check)
130
139
  return checks
131
140
 
@@ -193,23 +202,33 @@ def main(context: Context, argv: Sequence[str] | None = None) -> int:
193
202
  action="append",
194
203
  help="Used to match a subset of checks.",
195
204
  )
205
+ parser.add_argument(
206
+ "--exclude-tag",
207
+ type=str,
208
+ action="append",
209
+ help="Used to unmatch checks.",
210
+ )
196
211
  parser.add_argument(
197
212
  "--check-only", action="store_true", help="Do not run fixers."
198
213
  )
199
214
  args = parser.parse_args(argv)
200
215
 
201
216
  match_tags: set[str] = set(args.tag if args.tag else ())
217
+ exclude_tags: set[str] = set(args.exclude_tag if args.exclude_tag else ())
218
+
219
+ if not constants.DARWIN:
220
+ exclude_tags.add("colima")
202
221
 
203
222
  # First, we load builtin checks. These are not repo specific.
204
- checks = load_builtin_checks(match_tags)
223
+ checks = load_builtin_checks(match_tags, exclude_tags)
205
224
 
206
225
  # Then we load any repo specific checks if any.
207
226
  repo = context.get("repo")
208
227
  if repo is not None:
209
- checks.extend(load_checks(repo, match_tags))
228
+ checks.extend(load_checks(repo, match_tags, exclude_tags))
210
229
 
211
230
  if not checks:
212
- print(f"No checks found for tags: {args.tag}")
231
+ print("No checks found.")
213
232
  return 1
214
233
 
215
234
  # We run every check on a separate thread, aggregate the results,
@@ -6,10 +6,7 @@ import os
6
6
  import sys
7
7
  from collections.abc import Sequence
8
8
 
9
- from devenv.constants import CI
10
- from devenv.constants import DARWIN
11
- from devenv.constants import EXTERNAL_CONTRIBUTOR
12
- from devenv.constants import homebrew_bin
9
+ from devenv import constants
13
10
  from devenv.lib import proc
14
11
  from devenv.lib.context import Context
15
12
  from devenv.lib.modules import DevModuleInfo
@@ -35,33 +32,16 @@ def main(context: Context, argv: Sequence[str] | None = None) -> ExitCode:
35
32
  "getsentry/sentry",
36
33
  "getsentry/getsentry",
37
34
  ]:
38
- fetch(code_root, "getsentry/sentry", auth=CI is None, sync=False)
39
-
40
- if DARWIN:
41
- print("Installing sentry's brew dependencies...")
42
- if CI:
43
- # Installing everything from brew takes too much time,
44
- # and chromedriver cask flakes occasionally. Really all we need to
45
- # set up the devenv is colima and docker-cli.
46
- # This is also required for arm64 macOS GHA runners.
47
- # We manage colima, so just need to install docker + qemu here.
48
- proc.run(("brew", "install", "docker", "qemu"))
49
- else:
50
- proc.run(
51
- (f"{homebrew_bin}/brew", "bundle"),
52
- cwd=f"{code_root}/sentry",
53
- )
54
- else:
55
- print(
56
- "Not on MacOS; assuming you have a docker cli and runtime installed."
57
- )
35
+ fetch(
36
+ code_root, "getsentry/sentry", auth=constants.CI is None, sync=False
37
+ )
58
38
 
59
39
  proc.run(
60
40
  (sys.executable, "-P", "-m", "devenv", "sync"),
61
41
  cwd=f"{code_root}/sentry",
62
42
  )
63
43
 
64
- if not CI and not EXTERNAL_CONTRIBUTOR:
44
+ if not constants.CI and not constants.EXTERNAL_CONTRIBUTOR:
65
45
  fetch(code_root, "getsentry/getsentry")
66
46
 
67
47
  print(
@@ -88,25 +68,24 @@ def fetch(
88
68
 
89
69
  if os.path.exists(reporoot):
90
70
  print(f"{reporoot} already exists")
91
- return
92
-
93
- print(f"fetching {repo} into {reporoot}")
94
-
95
- additional_args = (
96
- # git@ clones forces the use of cloning through SSH which is what we want,
97
- # though CI must clone open source repos via https (no git authentication)
98
- (f"git@github.com:{repo}",)
99
- if auth
100
- else (
101
- "--depth",
102
- "1",
103
- "--single-branch",
104
- f"--branch={os.environ['DEVENV_FETCH_BRANCH']}",
105
- f"https://github.com/{repo}",
71
+ else:
72
+ print(f"fetching {repo} into {reporoot}")
73
+
74
+ additional_args = (
75
+ # git@ clones forces the use of cloning through SSH which is what we want,
76
+ # though CI must clone open source repos via https (no git authentication)
77
+ (f"git@github.com:{repo}",)
78
+ if auth
79
+ else (
80
+ "--depth",
81
+ "1",
82
+ "--single-branch",
83
+ f"--branch={os.environ['DEVENV_FETCH_BRANCH']}",
84
+ f"https://github.com/{repo}",
85
+ )
106
86
  )
107
- )
108
87
 
109
- proc.run(("git", "-C", coderoot, "clone", *additional_args), exit=True)
88
+ proc.run(("git", "-C", coderoot, "clone", *additional_args), exit=True)
110
89
 
111
90
  context_post_fetch = {
112
91
  "reporoot": reporoot,
@@ -117,6 +96,7 @@ def fetch(
117
96
  # optional post-fetch, meant for recommended but not required defaults
118
97
  fp = f"{reporoot}/devenv/post_fetch.py"
119
98
  if os.path.exists(fp):
99
+ print(f"running {fp}")
120
100
  spec = importlib.util.spec_from_file_location("post_fetch", fp)
121
101
 
122
102
  module = importlib.util.module_from_spec(spec) # type: ignore
@@ -127,6 +107,7 @@ def fetch(
127
107
  print(f"warning! failed running {fp} (code {rc})")
128
108
 
129
109
  if sync:
110
+ print("running devenv sync")
130
111
  proc.run((sys.executable, "-P", "-m", "devenv", "sync"), cwd=reporoot)
131
112
 
132
113
 
@@ -63,8 +63,6 @@ def install_global() -> None:
63
63
  "darwin_x86_64_sha256": "791330c62c60389f70e5e1c33a56c35502a9e36e544a418daea0273e539acbf4",
64
64
  "darwin_arm64": f"https://github.com/abiosoft/colima/releases/download/{version}/colima-Darwin-arm64",
65
65
  "darwin_arm64_sha256": "c266fcb272b39221ef6152d2093bb02a1ebadc26042233ad359e1ae52d5d5922",
66
- "linux_x86_64": f"https://github.com/abiosoft/colima/releases/download/{version}/colima-Linux-x86_64",
67
- "linux_x86_64_sha256": "f2d6664a79ff3aa35f0718aac2ba9f6b531772e1464f3b096c1ac2aab404943e",
68
66
  }
69
67
 
70
68
  binroot = f"{root}/bin"
@@ -113,8 +113,6 @@ def install_global() -> None:
113
113
  "darwin_x86_64_sha256": "1b621d4c9a57ff361811cf29754aafb0c28bc113c70011927af8d73c2c162186",
114
114
  "darwin_arm64": f"https://download.docker.com/mac/static/stable/aarch64/docker-{version}.tgz",
115
115
  "darwin_arm64_sha256": "9dae125282116146b06eb777c2125ddda6c0468c0b9ad6c72a82edbc6783a77b",
116
- "linux_x86_64": f"https://download.docker.com/linux/static/stable/x86_64/docker-{version}.tgz",
117
- "linux_x86_64_sha256": "9b4f6fe406e50f9085ee474c451e2bb5adb119a03591f467922d3b4e2ddf31d3",
118
116
  }
119
117
 
120
118
  version_buildx = "v0.22.0"
@@ -123,8 +121,6 @@ def install_global() -> None:
123
121
  "darwin_x86_64_sha256": "5221ad6b8acd2283f8fbbeebc79ae4b657e83519ca1c1e4cfbb9405230b3d933",
124
122
  "darwin_arm64": f"https://github.com/docker/buildx/releases/download/{version_buildx}/buildx-{version_buildx}.darwin-arm64",
125
123
  "darwin_arm64_sha256": "5898c338abb1f673107bc087997dc3cb63b4ea66d304ce4223472f57bd8d616e",
126
- "linux_x86_64": f"https://github.com/docker/buildx/releases/download/{version_buildx}/buildx-{version_buildx}.linux-amd64",
127
- "linux_x86_64_sha256": "805195386fba0cea5a1487cf0d47da82a145ea0a792bd3fb477583e2dbcdcc2f",
128
124
  }
129
125
 
130
126
  binroot = f"{root}/bin"
@@ -37,10 +37,7 @@ def _install(url: str, sha256: str, into: str) -> None:
37
37
  archive_file = archive.download(url, sha256, dest=f"{tmpd}/download")
38
38
 
39
39
  # the archive from homebrew has a lima/version prefix
40
- if url.startswith("https://ghcr.io/v2/homebrew"):
41
- archive.unpack_strip_n(archive_file, tmpd, n=2)
42
- else:
43
- archive.unpack(archive_file, tmpd)
40
+ archive.unpack_strip_n(archive_file, tmpd, n=2)
44
41
 
45
42
  # the archive was atomically placed into tmpd so
46
43
  # these are on the same fs and can be atomically moved too
@@ -75,10 +72,6 @@ def install_global() -> None:
75
72
  # arm64_sonoma
76
73
  "darwin_arm64": "https://ghcr.io/v2/homebrew/core/lima/blobs/sha256:8aeb0a3b7295f0c3e0c2a7a92a798a44397936e5bb732db825aee6da5e762d7a",
77
74
  "darwin_arm64_sha256": "8aeb0a3b7295f0c3e0c2a7a92a798a44397936e5bb732db825aee6da5e762d7a",
78
- # on linux we use github releases since most people are probably not using
79
- # linuxbrew and the go binary in homebrew links to linuxbrew's ld.so
80
- "linux_x86_64": f"https://github.com/lima-vm/lima/releases/download/v{version}/lima-{version}-Linux-x86_64.tar.gz",
81
- "linux_x86_64_sha256": "b109cac29569a4aacab01c588f922ea6c7e2ef06ce9260bbc4c382e475bc3b98",
82
75
  }
83
76
 
84
77
  binroot = f"{root}/bin"
@@ -36,11 +36,16 @@ Updating global tools (at {constants.root}/bin).
36
36
  """
37
37
  )
38
38
  os.makedirs(f"{constants.root}/bin", exist_ok=True)
39
- brew.install()
40
- docker.install_global()
39
+
40
+ if constants.DARWIN:
41
+ # we only install brew and colima-related stuff on macos
42
+ brew.install()
43
+ docker.install_global()
44
+ colima.install_global()
45
+ limactl.install_global()
46
+
41
47
  direnv.install()
42
- colima.install_global()
43
- limactl.install_global()
48
+
44
49
  return 0
45
50
 
46
51
  is_global_devenv = sys.executable.startswith(
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sentry_devenv"
7
- version = "1.26.1"
7
+ version = "1.27.0"
8
8
  authors = [
9
9
  { name="Joshua Li", email="joshua.li@sentry.io" },
10
10
  { name="Ian Woodard", email="ian.woodard@sentry.io" },
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry_devenv
3
- Version: 1.26.1
3
+ Version: 1.27.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
@@ -98,7 +98,7 @@ Everything devenv needs is in `~/.local/share/sentry-devenv`.
98
98
  - `direnv`
99
99
  - we currently rely on direnv and a minimal [`[reporoot]/.envrc`](#direnv) to add `[reporoot]/.devenv/bin` to PATH
100
100
  - see [examples](#examples) for .envrc suggestions
101
- - global tools: `docker` (cli), `colima`
101
+ - global tools (macos only; you are otherwise expected to install docker yourself): `docker` (cli), `colima`
102
102
 
103
103
 
104
104
  ### runtime
@@ -9,12 +9,15 @@ from devenv.lib.repository import Repository
9
9
 
10
10
 
11
11
  def test_load_checks_no_checks() -> None:
12
- assert doctor.load_checks(Repository("not a real repository"), set()) == []
12
+ assert (
13
+ doctor.load_checks(Repository("not a real repository"), set(), set())
14
+ == []
15
+ )
13
16
 
14
17
 
15
18
  def test_load_checks_test_checks(capsys: pytest.CaptureFixture[str]) -> None:
16
19
  loaded_checks = doctor.load_checks(
17
- Repository(os.path.join(os.path.dirname(__file__))), set()
20
+ Repository(os.path.join(os.path.dirname(__file__))), set(), set()
18
21
  )
19
22
  loaded_check_names = [check.name for check in loaded_checks]
20
23
  assert len(loaded_check_names) == 5
@@ -37,7 +40,7 @@ def test_load_checks_test_checks(capsys: pytest.CaptureFixture[str]) -> None:
37
40
 
38
41
  def test_load_checks_only_passing_tag() -> None:
39
42
  loaded_checks = doctor.load_checks(
40
- Repository(os.path.join(os.path.dirname(__file__))), {"pass"}
43
+ Repository(os.path.join(os.path.dirname(__file__))), {"pass"}, set()
41
44
  )
42
45
  loaded_check_names = [check.name for check in loaded_checks]
43
46
  assert len(loaded_check_names) == 1
@@ -46,7 +49,7 @@ def test_load_checks_only_passing_tag() -> None:
46
49
 
47
50
  def test_load_checks_only_failing_tag() -> None:
48
51
  loaded_checks = doctor.load_checks(
49
- Repository(os.path.join(os.path.dirname(__file__))), {"fail"}
52
+ Repository(os.path.join(os.path.dirname(__file__))), {"fail"}, set()
50
53
  )
51
54
  loaded_check_names = [check.name for check in loaded_checks]
52
55
  assert len(loaded_check_names) == 2
@@ -56,7 +59,9 @@ def test_load_checks_only_failing_tag() -> None:
56
59
 
57
60
  def test_load_checks_passing_and_failing_tag() -> None:
58
61
  loaded_checks = doctor.load_checks(
59
- Repository(os.path.join(os.path.dirname(__file__))), {"pass", "fail"}
62
+ Repository(os.path.join(os.path.dirname(__file__))),
63
+ {"pass", "fail"},
64
+ set(),
60
65
  )
61
66
  loaded_check_names = [check.name for check in loaded_checks]
62
67
  assert len(loaded_check_names) == 0
@@ -64,7 +69,7 @@ def test_load_checks_passing_and_failing_tag() -> None:
64
69
 
65
70
  def test_load_checks_test_tag() -> None:
66
71
  loaded_checks = doctor.load_checks(
67
- Repository(os.path.join(os.path.dirname(__file__))), {"test"}
72
+ Repository(os.path.join(os.path.dirname(__file__))), {"test"}, set()
68
73
  )
69
74
  loaded_check_names = [check.name for check in loaded_checks]
70
75
  assert len(loaded_check_names) == 5
@@ -73,3 +78,25 @@ def test_load_checks_test_tag() -> None:
73
78
  assert "failing check with msg" in loaded_check_names
74
79
  assert "broken check" in loaded_check_names
75
80
  assert "broken fix" in loaded_check_names
81
+
82
+
83
+ def test_load_checks_exclude_passing_tag() -> None:
84
+ loaded_checks = doctor.load_checks(
85
+ Repository(os.path.join(os.path.dirname(__file__))), {"test"}, {"pass"}
86
+ )
87
+ loaded_check_names = [check.name for check in loaded_checks]
88
+ assert len(loaded_check_names) == 4
89
+ assert "passing check" not in loaded_check_names
90
+ assert "failing check" in loaded_check_names
91
+ assert "failing check with msg" in loaded_check_names
92
+
93
+
94
+ def test_load_checks_exclude_failing_tag() -> None:
95
+ loaded_checks = doctor.load_checks(
96
+ Repository(os.path.join(os.path.dirname(__file__))), {"test"}, {"fail"}
97
+ )
98
+ loaded_check_names = [check.name for check in loaded_checks]
99
+ assert len(loaded_check_names) == 3
100
+ assert "passing check" in loaded_check_names
101
+ assert "failing check" not in loaded_check_names
102
+ assert "failing check with msg" not in loaded_check_names
File without changes