-
-
Notifications
You must be signed in to change notification settings - Fork 465
Use uv for managing python version #5009
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
base: 01-07-add_ai_rules_files_for_metrics_and_update_feature_flags_rule_
Are you sure you want to change the base?
Use uv for managing python version #5009
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Use uv for managing python version ([#5009](https://github.com/getsentry/sentry-java/pull/5009))If none of the above apply, you can opt out of this check by adding |
1eeaf9c to
af4f8c4
Compare
31b0acb to
53ea75b
Compare
| if not os.path.exists(".venv"): | ||
| proc.run(("uv", "venv", "--seed")) | ||
| proc.run(("uv", "sync", "--frozen", "--quiet")) |
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.
Bug: The script assumes it's running from the repository root when creating the .venv, but it can be invoked from other directories, causing environment setup to fail.
Severity: CRITICAL
Suggested Fix
Before line 18, change the current directory to the repository root using os.chdir(reporoot). Alternatively, modify the subsequent proc.run calls to use absolute paths for the virtual environment and specify the correct working directory, for example: proc.run(..., cwd=reporoot).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: devenv/sync.py#L18-L20
Potential issue: The script `devenv/sync.py` exhibits inconsistent handling of the
working directory. While an initial `uv.install()` call correctly uses the `reporoot`
context variable, subsequent operations to create and sync the virtual environment on
lines 18-20 use the relative path `.venv` without ensuring the current working directory
is the repository root. If `devenv sync` is invoked from any directory other than the
repository root, it will create the `.venv` in the wrong location, leading to a broken
development environment.
Did we get this right? 👍 / 👎 to inform future reviews.

📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps