Skip to content

Use setup-uv defaults for Python and the venv - #51

Merged
glenn-jocher merged 3 commits into
mainfrom
setup-uv-defaults
Oct 6, 2026
Merged

glenn-jocher merged 3 commits into
mainfrom
setup-uv-defaults

Conversation

@glenn-jocher

@glenn-jocher glenn-jocher commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Replaces actions/setup-python with ultralytics/actions/setup-uv. By default, that action now activates a venv on the newest Python preinstalled on the runner, with no Python download. Packages install into that venv, so --system is dropped. Jobs that pin a Python version keep the pin on setup-uv, which uses the preinstalled copy when the runner has one.

CI first ran against the setup-uv-defaults branch of ultralytics/actions#915. #915 is now merged (da5463a, released as 0.4.0), so setup-uv is back on @main, which carries the new defaults.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Updated the CI and push workflows to use setup-uv for Python setup and install packages into its virtual environment.

📊 Key Changes

  • Replaced actions/setup-python with ultralytics/actions/setup-uv in both workflows.
  • Passed the CI matrix Python version and the push job’s Python 3.12 pin to setup-uv.
  • Removed --system from both uv pip install commands.

🎯 Purpose & Impact

  • Python selection and package installation now use the environment managed by setup-uv; the existing Python version pins remain in place.

@UltralyticsAssistant UltralyticsAssistant added the enhancement New feature or request label Oct 6, 2026
@UltralyticsAssistant

Copy link
Copy Markdown
Member

👋 Hello @glenn-jocher, thank you for submitting a ultralytics/replicate 🚀 PR! This automated message confirms your contribution was received, and an Ultralytics engineer will assist with the review. To ensure a seamless integration of your work, please review the following checklist:

  • ✅ Define a Purpose: Clearly explain the purpose of your fix or feature in your PR description, and link to any relevant issues. Ensure your commit messages are clear, concise, and adhere to the project's conventions.
  • ✅ Synchronize with Source: Confirm your PR is synchronized with the ultralytics/replicate main branch. If it's behind, update it by clicking the 'Update branch' button or by running git pull and git merge main locally.
  • ✅ Ensure CI Checks Pass: Verify all Ultralytics Continuous Integration (CI) checks are passing. If any checks fail, please address the issues.
  • ✅ Update Documentation: Update the relevant documentation for any new or modified features.
  • ✅ Add Tests: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
  • ✅ Sign the CLA: Please ensure you have signed our Contributor License Agreement if this is your first Ultralytics PR; the CLA check will comment with signing instructions if needed.
  • ✅ Minimize Changes: Limit your changes to the minimum necessary for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review

Made with ❤️ by Ultralytics Actions

Reviewed the CI and deployment workflow changes. The new setup-uv defaults are used consistently, and package installs and subsequent Python commands run in the activated venv. LGTM.

@UltralyticsAssistant
UltralyticsAssistant dismissed their stale review October 6, 2026 17:19

Superseded by new review

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review 2

Made with ❤️ by Ultralytics Actions

Review 2: the earlier LGTM is reversed because the workflow refs remain @main, despite the PR's stated validation against setup-uv-defaults. This leaves the new installs relying on defaults that this PR does not select; update both refs before merging.

💬 Posted 1 inline comment
  • ⚠️ HIGH .github/workflows/ci.yml:34 Both workflows still reference ultralytics/actions/setup-uv@main, so this CI run does not use the setup-uv-defaults branch described in the PR. Since this change removes --system and relies on that branch's activated venv defaults, the install can fail without an active venv. Point the action refs in both workflows at @setup-uv-defaults for validation, then switch them back after #915 merges.

Comment thread .github/workflows/ci.yml
- name: Install dependencies
run: |
uv pip install --system -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
uv pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ultralytics/actions#915 merged at 17:18 UTC (da5463a, released as 0.4.0), so setup-uv@main now carries the new defaults and this CI run exercises them. The validation commit pointing at @setup-uv-defaults was already reverted, and the PR description is updated to match.

Comment thread .github/workflows/ci.yml
- name: Install dependencies
run: |
uv pip install --system -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
uv pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ultralytics/actions#915 merged at 17:18 UTC (da5463a, released as 0.4.0), so setup-uv@main now carries the new defaults and this CI run exercises them. The validation commit pointing at @setup-uv-defaults was already reverted, and the PR description is updated to match.

@UltralyticsAssistant UltralyticsAssistant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 PR Review 3

Made with ❤️ by Ultralytics Actions

Since review 2, the @main concern is resolved: setup-uv now activates a venv by default, and these workflows retain their explicit Python-version pins while installing dependencies into that environment. No remaining regression found; LGTM. (raw.githubusercontent.com)

@glenn-jocher
glenn-jocher merged commit 17530ac into main Oct 6, 2026
22 checks passed
@glenn-jocher
glenn-jocher deleted the setup-uv-defaults branch October 6, 2026 17:46
@UltralyticsAssistant

Copy link
Copy Markdown
Member

🎉 PR #51 is merged—thank you, @glenn-jocher, for updating the CI and push workflows to use setup-uv for Python setup and package installation.

“Well done is better than well said.” — Benjamin Franklin

The workflows now install packages into the setup-uv-managed environment while preserving their Python version pins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants