-
Notifications
You must be signed in to change notification settings - Fork 103
feat: Uv take 3, no pyproject.toml and with pinned setuptools and wheel #5369
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
Merged
joshuarli
merged 14 commits into
master
from
feat-uv-no-pyproject-toml-with-pinned-setuptools
Nov 12, 2025
Merged
Changes from 5 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f7e08e6
Revert "build(py): Revert `uv`, `devenv`, `pre-commit` (#5321)"
joshuarli 6c9f0da
upgrade python to 3.13, pin setuptools 65.5.1
joshuarli 6b758d1
[skip ci] wip
joshuarli 76cf698
pin setuptools and wheel
joshuarli 132cf41
tools/verify_wheel.py
joshuarli 093313a
temporarily exercise build_library
joshuarli fe40979
Merge remote-tracking branch 'origin' into feat-uv-no-pyproject-toml-…
joshuarli 17e307e
port py/tools/verify_wheel.py away from twine
joshuarli 99a72c8
upgrade to good wheel version and current setuptools
joshuarli bf380a4
also verify linux
joshuarli 4552e1f
fix
joshuarli ee513ac
update readme
joshuarli 8f175e0
revert
joshuarli 6487b8f
Merge remote-tracking branch 'origin/master' into feat-uv-no-pyprojec…
joshuarli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,22 @@ | ||
| #!/bin/bash | ||
| #!/not/executable/bash | ||
|
|
||
| # Our policy is that the .envrc is entirely optional, and a user | ||
| # without direnv should not really have a worse dev experience in any way. | ||
|
|
||
| # 'make' is in charge of creating and managing virtualenvs, and things like | ||
| # pytest can still be directly invoked using .venv/bin/pytest | ||
| if [[ -f "${PWD}/.env" ]]; then | ||
| dotenv | ||
| fi | ||
|
|
||
| PATH_add "${HOME}/.local/share/sentry-devenv/bin" | ||
|
|
||
| if ! source .venv/bin/activate; then | ||
| echo "!!! you have no virtualenv, run 'make setup' to fix that." | ||
| # XXX: ideally, direnv is able to export PS1 as modified by sourcing venvs | ||
| # but we'd have to patch direnv, and ".venv" isn't descriptive anyways | ||
| unset PS1 | ||
| if ! command -v devenv >/dev/null; then | ||
| echo "install devenv: https://github.com/getsentry/devenv#install" | ||
| return 1 | ||
| fi | ||
|
|
||
| PATH_add "${PWD}/.devenv/bin" | ||
|
|
||
| export VIRTUAL_ENV="${PWD}/.venv" | ||
| PATH_add "${PWD}/.venv/bin" | ||
|
|
||
| PATH_add /opt/homebrew/opt/rustup/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,16 +39,21 @@ jobs: | |
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Get changed files | ||
| id: changes | ||
| uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | ||
| with: | ||
| list-files: json | ||
| filters: | | ||
| all: | ||
| - added|modified: '**/*' | ||
|
|
||
| - name: Setup SSH agent | ||
| if: env.SSH_PRIVATE_KEY != '' | ||
| uses: webfactory/[email protected] | ||
| with: | ||
| ssh-private-key: ${{ env.SSH_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.13" | ||
|
|
||
| - name: Install Rust Toolchain | ||
| run: | | ||
| rustup toolchain install stable --profile minimal --no-self-update | ||
|
|
@@ -58,7 +63,34 @@ jobs: | |
| with: | ||
| key: ${{ github.job }} | ||
|
|
||
| - run: make style lint | ||
| - uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6 | ||
| with: | ||
| version: '0.8.2' | ||
| # we just cache the venv-dir directly in action-setup-venv | ||
| enable-cache: false | ||
|
|
||
| - uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0 | ||
| with: | ||
| cache-dependency-path: uv.lock | ||
| install-cmd: uv sync --frozen --only-dev --active | ||
|
|
||
| - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ~/.cache/pre-commit | ||
| key: cache-epoch-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml', 'uv.lock') }} | ||
|
|
||
| - name: Setup pre-commit | ||
| run: pre-commit install-hooks | ||
|
|
||
| - name: Run pre-commit | ||
| run: | | ||
| jq '.[]' --raw-output <<< '${{steps.changes.outputs.all_files}}' | | ||
| # Run pre-commit to lint and format check files that were changed (but not deleted) | ||
| xargs pre-commit run --files | ||
|
|
||
| # running lint-python will unnecessarily go through setup-venv via devenv | ||
| # we want to take advantage of cached action-setup-venv | ||
| - run: make style-rust lint-rust | ||
|
|
||
| - name: Check Docs | ||
| run: cargo doc --workspace --all-features --no-deps --document-private-items | ||
|
|
@@ -214,19 +246,23 @@ jobs: | |
| - name: Install Rust Toolchain | ||
| run: rustup toolchain install stable --profile minimal --no-self-update | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| - uses: swatinem/rust-cache@v2 | ||
| with: | ||
| python-version: "3.13" | ||
| key: ${{ github.job }} | ||
|
|
||
| - name: Install Dependencies | ||
| run: pip install -U pytest | ||
| - uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6 | ||
| with: | ||
| version: '0.8.2' | ||
| # we just cache the venv-dir directly in action-setup-venv | ||
| enable-cache: false | ||
|
|
||
| - uses: swatinem/rust-cache@v2 | ||
| - uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0 | ||
| with: | ||
| key: ${{ github.job }} | ||
| cache-dependency-path: uv.lock | ||
| install-cmd: uv sync --frozen --active | ||
|
|
||
| - name: Build and Install Library | ||
| run: pip install -v --editable py | ||
| run: uv pip install py/ | ||
| env: | ||
| RELAY_DEBUG: 1 | ||
|
|
||
|
|
@@ -749,9 +785,16 @@ jobs: | |
| with: | ||
| ssh-private-key: ${{ env.SSH_PRIVATE_KEY }} | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| - uses: astral-sh/setup-uv@884ad927a57e558e7a70b92f2bccf9198a4be546 # v6 | ||
| with: | ||
| python-version: "3.13" | ||
| version: '0.8.2' | ||
| # we just cache the venv-dir directly in action-setup-venv | ||
| enable-cache: false | ||
|
|
||
| - uses: getsentry/action-setup-venv@0958463ee0e02b9e8aa8f8e031afae1f84b80881 # v3.0.0 | ||
| with: | ||
| cache-dependency-path: uv.lock | ||
| install-cmd: uv sync --frozen --only-dev --active | ||
|
|
||
| - run: make test-integration | ||
| env: | ||
|
|
@@ -839,13 +882,22 @@ jobs: | |
| docker compose logs | ||
|
|
||
| validate-devservices-config: | ||
| runs-on: ubuntu-24.04 | ||
| needs: devservices-files-changed | ||
| if: needs.devservices-files-changed.outputs.devservices-files-changed == 'true' | ||
| steps: | ||
| - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.1.7 | ||
| name: Checkout repository | ||
| - uses: getsentry/action-validate-devservices-config@02a078d1280293e6598cabfbd318a01609c12c83 | ||
| name: Validate devservices config | ||
| with: | ||
| requirements-file-path: requirements-dev.txt | ||
| runs-on: ubuntu-24.04 | ||
| needs: devservices-files-changed | ||
| if: needs.devservices-files-changed.outputs.devservices-files-changed == 'true' | ||
| steps: | ||
| - uses: actions/[email protected] | ||
| name: Checkout repository | ||
|
|
||
| - name: Get devservices version | ||
| id: get-devservices-version | ||
| run: | | ||
| awk -F'"' ' | ||
| /name/ { pkg = $2 } | ||
| /version/ { if (pkg == "devservices") print "version="$2 } | ||
| ' uv.lock >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: getsentry/action-validate-devservices-config@711ae7221998ddf81211f25f5e3873ecffd22387 | ||
| name: Validate devservices config | ||
| with: | ||
| devservices-version: ${{ steps.get-devservices-version.outputs.version }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.11.9 | ||
| 3.13.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| brew 'librdkafka' | ||
|
|
||
| brew 'rustup' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this TODO for this PR, or for later?
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.
#5070 (comment)
\shrug