Support modern uv project management (uv init + uv add)#3474
Open
igorts-git wants to merge 1 commit intomainfrom
Open
Support modern uv project management (uv init + uv add)#3474igorts-git wants to merge 1 commit intomainfrom
igorts-git wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d04ab05 to
902af4e
Compare
bbf60a9 to
60c2135
Compare
3 tasks
ee64b4b to
3b78b37
Compare
- Update MaxText installation scripts to detect 'uv.lock' and use 'uv add --frozen'. - Consolidate uv detection and installation logic into a shared 'uv_utils.py' module. - Improve uv detection robustness by prioritizing 'python -m uv' and path lookup. - Provide 'install_requirements' and 'install_editable' helpers for easier dependency management. - Update docs/install_maxtext.md with uv project management workflow instructions and fix outdated paths.
3b78b37 to
5220a95
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Objective
Enable users to use MaxText seamlessly within their own
uv-managed projects. Previously, MaxText's installation scripts relied exclusively onuv pip install, which does not update a project'spyproject.tomloruv.lock. This PR introduces automatic detection ofuvprojects and usesuv addto correctly track "extra" dependencies (like GitHub-based requirements) when applicable.Background
There is a "modern" uv usage mode that is different from the traditional uv pip install flow.
The new mode requires
uv initanduv addcommands instead ofuv pip install.This PR makes it compatible with the new flow.
Key changes:
uv-managed project detection: Created a helper moduleuv_utilswhich provides arun_installhelper function to use the correct uv command to run based on the presence of auv.lockfile in the current working directory. Changedinstall_pre_train_deps.pyandinstall_post_train_deps.pyto use the newuv_utils.run_install().docs/install_maxtext.mdwith instructions for the modernuvworkflow and corrected several outdated paths and command names.Pair-programmed with Gemini-CLI.
FIXES: #3441
Tests
1. Build a new Wheel
To verify that the package metadata and entry points are correctly defined:
2. Verify Legacy Installation (
uv pip install)Ensures no regressions for existing users installing the package artifact:
3. Verify Modern Installation (
uv add)Tests the new project management workflow using the package artifact:
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.