Skip to content

Commit 526841f

Browse files
committed
add uv
1 parent 822a12e commit 526841f

File tree

7 files changed

+268
-0
lines changed

7 files changed

+268
-0
lines changed

.envrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
if [[ -f "${PWD}/.env" ]]; then
2+
dotenv
3+
fi
4+
5+
PATH_add "${HOME}/.local/share/sentry-devenv/bin"
6+
7+
if ! command -v devenv >/dev/null; then
8+
echo "install devenv: https://github.com/getsentry/devenv#install"
9+
return 1
10+
fi
11+
12+
PATH_add "${PWD}/.devenv/bin"
13+
14+
export VIRTUAL_ENV="${PWD}/.venv"
15+
16+
PATH_add "${PWD}/.venv/bin"

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13.3

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ sentry internal pypi
66
this repository contains the tools to import and/or build packages from public pypi for the
77
platforms and achitectures required for sentry development.
88

9+
## setup
10+
11+
```bash
12+
devenv sync
13+
```
14+
15+
to run tests: `tox`
16+
17+
918
## adding packages
1019

1120
packages are configured in the `packages.ini` file.

devenv/config.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[devenv]
2+
minimum_version = 1.22.1
3+
4+
[uv]
5+
darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-apple-darwin.tar.gz
6+
darwin_arm64_sha256 = 954d24634d5f37fa26c7af75eb79893d11623fc81b4de4b82d60d1ade4bfca22
7+
darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-apple-darwin.tar.gz
8+
darwin_x86_64_sha256 = ae755df53c8c2c1f3dfbee6e3d2e00be0dfbc9c9b4bdffdb040b96f43678b7ce
9+
linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-unknown-linux-gnu.tar.gz
10+
linux_arm64_sha256 = 27da35ef54e9131c2e305de67dd59a07c19257882c6b1f3cf4d8d5fbb8eaf4ca
11+
linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-unknown-linux-gnu.tar.gz
12+
linux_x86_64_sha256 = 6dcb28a541868a455aefb2e8d4a1283dd6bf888605a2db710f0530cec888b0ad
13+
# used for autoupdate
14+
version = 0.8.2

devenv/sync.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from __future__ import annotations
2+
3+
from devenv import constants
4+
from devenv.lib import config
5+
from devenv.lib import proc
6+
from devenv.lib import uv
7+
8+
9+
def main(context: dict[str, str]) -> int:
10+
reporoot = context["reporoot"]
11+
cfg = config.get_repo(reporoot)
12+
13+
uv.install(
14+
cfg["uv"]["version"],
15+
cfg["uv"][constants.SYSTEM_MACHINE],
16+
cfg["uv"][f"{constants.SYSTEM_MACHINE}_sha256"],
17+
reporoot,
18+
)
19+
20+
print("syncing .venv ...")
21+
proc.run(("uv", "sync", "--frozen", "--quiet"))
22+
23+
return 0

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[project]
2+
name = "pypi"
3+
version = "0.0.0"
4+
5+
[dependency-groups]
6+
# Currently we're just doing this much to get `devenv sync` to be able to
7+
# run tox and packaging for local python -m add_pkg.
8+
# Not sure it would be worth the effort right now to move everything to pure pytest
9+
# and run pytest on 3 different python versions in ci by swapping out .python-version.
10+
# Tox remains the most ergonomic solution to test on multiple pythons.
11+
dev = [
12+
"packaging==21.3",
13+
"sentry-devenv>=1.25.0",
14+
"tox==3.25.1",
15+
]
16+
17+
[tool.uv]
18+
environments = ["sys_platform == 'darwin' or sys_platform == 'linux'"]
19+
20+
[[tool.uv.index]]
21+
url = "https://pypi.devinfra.sentry.io/simple"
22+
default = true

uv.lock

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)