sentry-devenv 1.20.0__py3-none-any.whl → 1.22.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/lib/colima.py +3 -0
- devenv/lib/uv.py +56 -0
- devenv/main.py +1 -1
- {sentry_devenv-1.20.0.dist-info → sentry_devenv-1.22.0.dist-info}/METADATA +76 -14
- {sentry_devenv-1.20.0.dist-info → sentry_devenv-1.22.0.dist-info}/RECORD +9 -8
- {sentry_devenv-1.20.0.dist-info → sentry_devenv-1.22.0.dist-info}/WHEEL +1 -1
- tests/lib/test_venv.py +4 -4
- {sentry_devenv-1.20.0.dist-info → sentry_devenv-1.22.0.dist-info}/entry_points.txt +0 -0
- {sentry_devenv-1.20.0.dist-info → sentry_devenv-1.22.0.dist-info}/top_level.txt +0 -0
devenv/lib/colima.py
CHANGED
|
@@ -174,6 +174,9 @@ def start(restart: bool = False) -> ColimaStatus:
|
|
|
174
174
|
if platform.machine() == "arm64":
|
|
175
175
|
args = [*args, "--vm-type=vz", "--vz-rosetta", "--mount-type=virtiofs"]
|
|
176
176
|
|
|
177
|
+
# removing all docker contexts to ensure only colima context is created
|
|
178
|
+
shutil.rmtree(f"{home}/.docker/contexts", ignore_errors=True)
|
|
179
|
+
|
|
177
180
|
proc.run(
|
|
178
181
|
(
|
|
179
182
|
# we share the "default" machine across repositories
|
devenv/lib/uv.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import shutil
|
|
5
|
+
import tempfile
|
|
6
|
+
|
|
7
|
+
from devenv.lib import archive
|
|
8
|
+
from devenv.lib import fs
|
|
9
|
+
from devenv.lib import proc
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _install(url: str, sha256: str, into: str) -> None:
|
|
13
|
+
with tempfile.TemporaryDirectory(dir=into) as tmpd:
|
|
14
|
+
archive_file = archive.download(url, sha256, dest=f"{tmpd}/download")
|
|
15
|
+
archive.unpack(archive_file, tmpd, perform_strip1=True)
|
|
16
|
+
|
|
17
|
+
# the archive was atomically placed into tmpd so
|
|
18
|
+
# these are on the same fs and can be atomically moved too
|
|
19
|
+
os.replace(f"{tmpd}/uv", f"{into}/uv")
|
|
20
|
+
os.replace(f"{tmpd}/uvx", f"{into}/uvx")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def uninstall(binroot: str) -> None:
|
|
24
|
+
for fp in (f"{binroot}/uv", f"{binroot}/uvx"):
|
|
25
|
+
try:
|
|
26
|
+
os.remove(fp)
|
|
27
|
+
except FileNotFoundError:
|
|
28
|
+
# it's better to do this than to guard with
|
|
29
|
+
# os.path.exists(fp) because if it's an invalid or circular
|
|
30
|
+
# symlink the result'll be False!
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _version(binpath: str) -> str:
|
|
35
|
+
stdout = proc.run((binpath, "--version"), stdout=True)
|
|
36
|
+
# uv 0.7.21 (77c771c7f 2025-07-14)
|
|
37
|
+
return stdout.split()[1]
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def install(version: str, url: str, sha256: str, reporoot: str) -> None:
|
|
41
|
+
binroot = fs.ensure_binroot(reporoot)
|
|
42
|
+
binpath = f"{binroot}/uv"
|
|
43
|
+
|
|
44
|
+
if shutil.which("uv", path=binroot) == binpath:
|
|
45
|
+
installed_version = _version(binpath)
|
|
46
|
+
if version == installed_version:
|
|
47
|
+
return
|
|
48
|
+
print(f"installed uv {installed_version} is unexpected!")
|
|
49
|
+
|
|
50
|
+
print(f"installing uv {version}...")
|
|
51
|
+
uninstall(binroot)
|
|
52
|
+
_install(url, sha256, binroot)
|
|
53
|
+
|
|
54
|
+
installed_version = _version(binpath)
|
|
55
|
+
if version != installed_version:
|
|
56
|
+
raise SystemExit("Failed to install uv {version}!")
|
devenv/main.py
CHANGED
|
@@ -103,7 +103,7 @@ def main() -> ExitCode:
|
|
|
103
103
|
# https://sentry.sentry.io/settings/projects/sentry-dev-env/keys/
|
|
104
104
|
dsn="https://9bdb053cb8274ea69231834d1edeec4c@o1.ingest.sentry.io/5723503",
|
|
105
105
|
# enable performance monitoring
|
|
106
|
-
|
|
106
|
+
traces_sample_rate=1.0,
|
|
107
107
|
)
|
|
108
108
|
|
|
109
109
|
return devenv(sys.argv, f"{home}/.config/sentry-devenv/config.ini")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sentry_devenv
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.22.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
|
|
@@ -47,7 +47,6 @@ To update this installation, run `devenv update`.
|
|
|
47
47
|
|
|
48
48
|
This is intended for initial setup of a new machine.
|
|
49
49
|
|
|
50
|
-
|
|
51
50
|
`devenv fetch [repository name]`
|
|
52
51
|
|
|
53
52
|
Any repository on github in the form of `[org]/[reponame]`
|
|
@@ -71,7 +70,6 @@ In general, our library is designed to isolate, as much as possible, a repo's de
|
|
|
71
70
|
For example, [gcloud](#gcloud) is installed to `[reporoot]/.devenv/bin/gcloud` (with the gcloud sdk at `[reporoot]/.devenv/bin/google-cloud-sdk`).
|
|
72
71
|
An exception to this would be python virtualenvs, which was implemented before the idea of `[reporoot]/.devenv`.
|
|
73
72
|
|
|
74
|
-
|
|
75
73
|
`devenv doctor`
|
|
76
74
|
|
|
77
75
|
Use this to diagnose and fix common issues.
|
|
@@ -79,14 +77,25 @@ Use this to diagnose and fix common issues.
|
|
|
79
77
|
Repo-specific checks and fixes can be defined in `[reporoot]/devenv/checks`.
|
|
80
78
|
Otherwise we have "builtin" checks and fixes in `devenv.checks`.
|
|
81
79
|
|
|
80
|
+
`devenv update`
|
|
81
|
+
|
|
82
|
+
This updates the global devenv installation, and global tools.
|
|
83
|
+
|
|
84
|
+
If you're upgrading from a particularly old devenv, it won't have `update` so you need to:
|
|
85
|
+
`~/.local/share/sentry-devenv/venv/bin/pip install -U sentry-devenv`
|
|
86
|
+
|
|
82
87
|
|
|
83
88
|
## technical overview
|
|
84
89
|
|
|
85
90
|
Everything devenv needs is in `~/.local/share/sentry-devenv`.
|
|
86
91
|
|
|
87
|
-
- `~/.local/share/sentry-devenv/bin` contains
|
|
88
|
-
-
|
|
89
|
-
-
|
|
92
|
+
- `~/.local/share/sentry-devenv/bin` contains:
|
|
93
|
+
- `devenv` itself
|
|
94
|
+
- `direnv`
|
|
95
|
+
- we currently rely on direnv and a minimal [`[reporoot]/.envrc`](#direnv) to add `[reporoot]/.devenv/bin` to PATH
|
|
96
|
+
- see [examples](#examples) for .envrc suggestions
|
|
97
|
+
- global tools: `docker` (cli), `colima`
|
|
98
|
+
|
|
90
99
|
|
|
91
100
|
### runtime
|
|
92
101
|
|
|
@@ -157,6 +166,59 @@ export VIRTUAL_ENV="${PWD}/.venv"
|
|
|
157
166
|
PATH_add "${PWD}/.venv/bin"
|
|
158
167
|
```
|
|
159
168
|
|
|
169
|
+
if using uv:
|
|
170
|
+
|
|
171
|
+
`[reporoot]/devenv/sync.py`
|
|
172
|
+
```py
|
|
173
|
+
from devenv.lib import uv
|
|
174
|
+
|
|
175
|
+
def main(context: dict[str, str]) -> int:
|
|
176
|
+
reporoot = context["reporoot"]
|
|
177
|
+
cfg = config.get_repo(reporoot)
|
|
178
|
+
|
|
179
|
+
uv.install(
|
|
180
|
+
cfg["uv"]["version"],
|
|
181
|
+
cfg["uv"][constants.SYSTEM_MACHINE],
|
|
182
|
+
cfg["uv"][f"{constants.SYSTEM_MACHINE}_sha256"],
|
|
183
|
+
reporoot,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# reporoot/.venv is the default venv location
|
|
187
|
+
print(f"syncing .venv ...")
|
|
188
|
+
proc.run(("uv", "sync", "--frozen", "--quiet"))
|
|
189
|
+
|
|
190
|
+
return 0
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
`[reporoot]/devenv/config.ini`
|
|
194
|
+
```ini
|
|
195
|
+
[uv]
|
|
196
|
+
darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-aarch64-apple-darwin.tar.gz
|
|
197
|
+
darwin_arm64_sha256 = c73af7a4e0bcea9b5b593a0c7e5c025ee78d8be3f7cd60bfeadc8614a16c92ef
|
|
198
|
+
darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-x86_64-apple-darwin.tar.gz
|
|
199
|
+
darwin_x86_64_sha256 = f8a9b4f4a80a44653344d36b53e148134176e8f7cc99f8e823676a57c884595e
|
|
200
|
+
linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-aarch64-unknown-linux-gnu.tar.gz
|
|
201
|
+
linux_arm64_sha256 = 1dae18211605b9d00767d913da5108aea50200a88372bf8a2e1f56abdbe509f0
|
|
202
|
+
linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.7.21/uv-x86_64-unknown-linux-gnu.tar.gz
|
|
203
|
+
linux_x86_64_sha256 = ca3e8898adfce5fcc891d393a079013fa4bd0d9636cef11aded8a7485bcba312
|
|
204
|
+
# used for autoupdate
|
|
205
|
+
version = 0.7.21
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
`[reporoot]/.python-version`
|
|
209
|
+
```
|
|
210
|
+
3.13.3
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
`[reporoot]/pyproject.toml`
|
|
214
|
+
```
|
|
215
|
+
[project]
|
|
216
|
+
name = "foo"
|
|
217
|
+
version = "0.0.0"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
or classic pip:
|
|
221
|
+
|
|
160
222
|
`[reporoot]/devenv/sync.py`
|
|
161
223
|
```py
|
|
162
224
|
from devenv.lib import config, venv
|
|
@@ -185,13 +247,13 @@ editable =
|
|
|
185
247
|
.
|
|
186
248
|
|
|
187
249
|
[python3.12.3]
|
|
188
|
-
darwin_x86_64 = https://github.com/
|
|
250
|
+
darwin_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-apple-darwin-install_only.tar.gz
|
|
189
251
|
darwin_x86_64_sha256 = c37a22fca8f57d4471e3708de6d13097668c5f160067f264bb2b18f524c890c8
|
|
190
|
-
darwin_arm64 = https://github.com/
|
|
252
|
+
darwin_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-apple-darwin-install_only.tar.gz
|
|
191
253
|
darwin_arm64_sha256 = ccc40e5af329ef2af81350db2a88bbd6c17b56676e82d62048c15d548401519e
|
|
192
|
-
linux_x86_64 = https://github.com/
|
|
254
|
+
linux_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz
|
|
193
255
|
linux_x86_64_sha256 = a73ba777b5d55ca89edef709e6b8521e3f3d4289581f174c8699adfb608d09d6
|
|
194
|
-
linux_arm64 = https://github.com/
|
|
256
|
+
linux_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-install_only.tar.gz
|
|
195
257
|
linux_arm64_sha256 = ec8126de97945e629cca9aedc80a29c4ae2992c9d69f2655e27ae73906ba187d
|
|
196
258
|
```
|
|
197
259
|
|
|
@@ -238,13 +300,13 @@ python = 3.12.3
|
|
|
238
300
|
requirements = inhouse-tool/requirements-dev.txt
|
|
239
301
|
|
|
240
302
|
[python3.12.3]
|
|
241
|
-
darwin_x86_64 = https://github.com/
|
|
303
|
+
darwin_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-apple-darwin-install_only.tar.gz
|
|
242
304
|
darwin_x86_64_sha256 = c37a22fca8f57d4471e3708de6d13097668c5f160067f264bb2b18f524c890c8
|
|
243
|
-
darwin_arm64 = https://github.com/
|
|
305
|
+
darwin_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-apple-darwin-install_only.tar.gz
|
|
244
306
|
darwin_arm64_sha256 = ccc40e5af329ef2af81350db2a88bbd6c17b56676e82d62048c15d548401519e
|
|
245
|
-
linux_x86_64 = https://github.com/
|
|
307
|
+
linux_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz
|
|
246
308
|
linux_x86_64_sha256 = a73ba777b5d55ca89edef709e6b8521e3f3d4289581f174c8699adfb608d09d6
|
|
247
|
-
linux_arm64 = https://github.com/
|
|
309
|
+
linux_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-install_only.tar.gz
|
|
248
310
|
linux_arm64_sha256 = ec8126de97945e629cca9aedc80a29c4ae2992c9d69f2655e27ae73906ba187d
|
|
249
311
|
```
|
|
250
312
|
|
|
@@ -6,7 +6,7 @@ devenv/colima.py,sha256=Dk9t6eu2DEoqqkY8xLmgiB96r-6zi3aXcvON3P8h1JQ,1537
|
|
|
6
6
|
devenv/constants.py,sha256=wl0sRfkNeJL-sML6MG5nS0zU-dwRo1mDPrhUSHHY1YQ,1498
|
|
7
7
|
devenv/doctor.py,sha256=tcwXrE2Y7Ued2gAXCXtfFkyXbG9DOi6jVobbq6DnuZs,8663
|
|
8
8
|
devenv/fetch.py,sha256=MbztGFOzBR4KDPG0TVWcQsA4pGXk61zrQXvh-C9xHuk,3904
|
|
9
|
-
devenv/main.py,sha256=
|
|
9
|
+
devenv/main.py,sha256=grOHjy0kUJjeGW8STg-WMneVYlkTRVMoFjNdIgt7sjg,3267
|
|
10
10
|
devenv/pin_gha.py,sha256=t7A5CV1bnYRa4SAikuoJeodHuwV6moIePvhQ1Zdc1eE,2187
|
|
11
11
|
devenv/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
devenv/pythons.py,sha256=ZcjBrkfmQEkiMP217VyTG48cyteJdYG_hoQ6oFKx_CU,1252
|
|
@@ -20,7 +20,7 @@ devenv/checks/test.py,sha256=AvxoA2W5qTO2ZpoXmjScLiJxXD3Y_limYp5yTjGSZ9U,701
|
|
|
20
20
|
devenv/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
devenv/lib/archive.py,sha256=75MjlDuwHVaazbNUr8vJmqTyl4Jz6KRd_fUcpwvPwec,4710
|
|
22
22
|
devenv/lib/brew.py,sha256=_7recvYh-LnUJC0eKnYK7F8AzGRL5bi_Khv0f_mgrlM,1795
|
|
23
|
-
devenv/lib/colima.py,sha256=
|
|
23
|
+
devenv/lib/colima.py,sha256=eyGtE5EmkKESwe1dENh5vp8LuuRTJNzP5ikkLv6wk3w,7526
|
|
24
24
|
devenv/lib/config.py,sha256=5eXYwM44AJ3w2VfVbCDqchYOL1zAjazNcirtM6kxxGw,3344
|
|
25
25
|
devenv/lib/context.py,sha256=4EDImK9pvTp3FqeNigevC9lbJsgdDO9D1t2_Y4NyPlc,207
|
|
26
26
|
devenv/lib/direnv.py,sha256=HDRUaIR0PMAQYiiTaw3gEQuh6Tdb7BUJmV7dBZdPztM,1325
|
|
@@ -35,6 +35,7 @@ devenv/lib/proc.py,sha256=eU7DHIk_66wgkHRmdtKbBKZTa6q4tl9QJbrlnQOQCls,2743
|
|
|
35
35
|
devenv/lib/repository.py,sha256=cDCgcZ6lw0bcWC6DrcDp3tz_MWObmgAyFq39TeU7YHY,1966
|
|
36
36
|
devenv/lib/rosetta.py,sha256=Lm-tDFut86o6l-Y55d5kTacRHTwrv5MFEymQpy7Qihc,1170
|
|
37
37
|
devenv/lib/tenv.py,sha256=EulO1xYh8wu6-QoDvQd3TVbaLvmztXqCV6ya5sBWZiw,3030
|
|
38
|
+
devenv/lib/uv.py,sha256=Kkc9CaMCZzm6cskFey7yZgDjzm-8jLqF-bgr7SpcyhM,1769
|
|
38
39
|
devenv/lib/venv.py,sha256=1HWY1uFXLP1YCGVX7Ik5R3tNilRCKrVXOZN42-k_5eQ,3188
|
|
39
40
|
devenv/lib_check/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
41
|
devenv/lib_check/brew.py,sha256=tId1IgItju-fulbmTXmmI2Oo_-q332rd1tUN5RSkTrs,544
|
|
@@ -70,9 +71,9 @@ tests/lib/test_fs.py,sha256=qhX9CQTTSht1f6ZJfmpsSFICTwPs--h_mLlS_1jnZQg,1670
|
|
|
70
71
|
tests/lib/test_github.py,sha256=IMEG2cmRaK_PMJprFE_ZMqPnZ0StwWqgznhhT_zVk3U,4526
|
|
71
72
|
tests/lib/test_proc.py,sha256=XH6OnxKPSSm3HvDjYHApputMKwgOE8lYqDuK2vK0Z0U,2626
|
|
72
73
|
tests/lib/test_repository.py,sha256=gUi1lkY7bha5WwZ5xcnENOlFYboVV8TFW1lCESvS0VA,787
|
|
73
|
-
tests/lib/test_venv.py,sha256=
|
|
74
|
-
sentry_devenv-1.
|
|
75
|
-
sentry_devenv-1.
|
|
76
|
-
sentry_devenv-1.
|
|
77
|
-
sentry_devenv-1.
|
|
78
|
-
sentry_devenv-1.
|
|
74
|
+
tests/lib/test_venv.py,sha256=3XGpINFBkn6Yq4OycsF-Ki4xMWAINt2g69uOHtkDU6k,3266
|
|
75
|
+
sentry_devenv-1.22.0.dist-info/METADATA,sha256=j0ITXXvRbq05d2FHittffCUP_oWLzs23yJmHTT9fnec,15457
|
|
76
|
+
sentry_devenv-1.22.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
77
|
+
sentry_devenv-1.22.0.dist-info/entry_points.txt,sha256=StsIuNugcoEU8jsPy6H9ECjzoDzOVKXl1vUaYTIGbzM,44
|
|
78
|
+
sentry_devenv-1.22.0.dist-info/top_level.txt,sha256=dOQExvIA0fj_EQjCrMTS7CCHNH7WZFHxEU0M7LlNcKQ,16
|
|
79
|
+
sentry_devenv-1.22.0.dist-info/RECORD,,
|
tests/lib/test_venv.py
CHANGED
|
@@ -23,13 +23,13 @@ bins =
|
|
|
23
23
|
sentry-kube-pop
|
|
24
24
|
|
|
25
25
|
[python3.11.6]
|
|
26
|
-
darwin_x86_64 = https://github.com/
|
|
26
|
+
darwin_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-x86_64-apple-darwin-install_only.tar.gz
|
|
27
27
|
darwin_x86_64_sha256 = 178cb1716c2abc25cb56ae915096c1a083e60abeba57af001996e8bc6ce1a371
|
|
28
|
-
darwin_arm64 = https://github.com/
|
|
28
|
+
darwin_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-aarch64-apple-darwin-install_only.tar.gz
|
|
29
29
|
darwin_arm64_sha256 = 916c35125b5d8323a21526d7a9154ca626453f63d0878e95b9f613a95006c990
|
|
30
|
-
linux_x86_64 = https://github.com/
|
|
30
|
+
linux_x86_64 = https://github.com/astral-sh/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-x86_64-unknown-linux-gnu-install_only.tar.gz
|
|
31
31
|
linux_x86_64_sha256 = ee37a7eae6e80148c7e3abc56e48a397c1664f044920463ad0df0fc706eacea8
|
|
32
|
-
linux_arm64 = https://github.com/
|
|
32
|
+
linux_arm64 = https://github.com/astral-sh/python-build-standalone/releases/download/20231002/cpython-3.11.6+20231002-aarch64-unknown-linux-gnu-install_only.tar.gz
|
|
33
33
|
linux_arm64_sha256 = 3e26a672df17708c4dc928475a5974c3fb3a34a9b45c65fb4bd1e50504cc84ec
|
|
34
34
|
"""
|
|
35
35
|
|
|
File without changes
|
|
File without changes
|