-
-
Notifications
You must be signed in to change notification settings - Fork 62
feat: uv #7368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -6,54 +6,69 @@ exclude: > | |||
) | |||
|
|||
repos: | |||
- repo: https://github.com/psf/black | |||
rev: 22.3.0 | |||
- repo: local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved all these python tool hooks to local so that we have a single source of truth which is in the uv lockfile
@@ -41,31 +40,13 @@ tests: test | |||
api-tests: | |||
SNUBA_SETTINGS=test pytest -vv tests/*_api.py | |||
|
|||
backend-typing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the previous backend typing ci job has been rolled up into pre-commit!
line_length = 100 | ||
lines_between_sections = 1 | ||
|
||
[tool.mypy] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also took the liberty of combining the previous mypy.ini and backend-typing flags into here in an improved more compact format!
VERSION = "25.9.0.dev0" | ||
|
||
|
||
def get_requirements() -> Sequence[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaict sdists and wheels are not being built for snuba so deleting this altogether
COPY ./rust_snuba/ ./rust_snuba/ | ||
COPY --from=build_rust_snuba_deps /usr/src/snuba/rust_snuba/target/ ./rust_snuba/target/ | ||
COPY --from=build_rust_snuba_deps /root/.cargo/ /root/.cargo/ | ||
RUN set -ex; \ | ||
cd ./rust_snuba/; \ | ||
rustup show active-toolchain || rustup toolchain install; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was being duplicated in build_rust_snuba_base so removed!
@@ -96,38 +106,26 @@ jobs: | |||
run: | | |||
make lint-rust format-rust-ci | |||
|
|||
typing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as noted elsewhere this has been rolled up into pre-commit!
|
||
- uses: getsentry/action-setup-venv@3a832a9604b3e1a4202ae559248f26867b467cc7 # v2.1.1 | ||
with: | ||
python-version: 3.11.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we read this value from .python-version
so this stays in sync with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Josh! Great work here!
This introduces uv, and also aligns this repository with these repo standards:
https://www.notion.so/sentry/Standard-Spec-devenv-2238b10e4b5d8072a992d8b67d94be22
https://www.notion.so/sentry/Standard-Spec-python-uv-2248b10e4b5d8045b8fff30f8b8b67ca
https://www.notion.so/sentry/Standard-Spec-pre-commit-2238b10e4b5d8019aa1fe1158e39c38e
The ability to run devenv sync and get a dev environment in any repo is the DX i'm aiming for,
and these standards provide a foundation from which later we can easily push updates to all repos.
You should be able to checkout this branch, run
direnv allow
anddevenv sync
(might be prompted to run~/.local/share/sentry-devenv/bin/devenv update
first), which will set up everything needed for development (except cargo).make watch-rust-snuba
will work the same as before, except now it works using uvx and rust_snuba as a workspace dep.