@@ -55,17 +55,17 @@ run: |
5555
5656 # Verify UV installation
5757 command -v uv || (echo "UV not found in PATH" && exit 1)
58-
59- # Alias to use system Python for all uv pip commands
60- shopt -s expand_aliases 2>/dev/null || true
61- alias uvpip="uv pip --system"
58+ # Create and activate a local uv virtual environment
59+ uv venv .venv -p "/usr/bin/python${python_version}" || uv venv .venv -p "python${python_version}" || uv venv .venv
60+ . .venv/bin/activate
61+ hash -r
6262
6363 whereis nvidia
6464 nvidia-smi
6565 python --version
6666 uv --version
67- uvpip install fire wget packaging
68- uvpip list
67+ uv pip install fire wget packaging
68+ uv pip list
6969 set -ex
7070
7171 CUDA_VERSION="${image##*cuda}" # Remove everything up to and including "cuda"
@@ -79,26 +79,26 @@ run: |
7979
8080 if [ "${python_version}" == "3.10" ]; then
8181 echo "Set oldest versions"
82- uvpip uninstall -y deepspeed
83- uvpip install --upgrade "lightning-utilities[cli]"
82+ uv pip uninstall -y deepspeed
83+ uv pip install --upgrade "lightning-utilities[cli]"
8484 cd requirements/fabric
8585 python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
8686 python -m lightning_utilities.cli requirements prune-pkgs --packages deepspeed --req_files strategies.txt
8787 cd ../..
88- uvpip install "cython<3.0" wheel # for compatibility
88+ uv pip install "cython<3.0" wheel # for compatibility
8989 fi
9090
9191 echo "Adjust torch versions in requirements files"
9292 PYTORCH_VERSION=$(python -c "import torch; print(torch.__version__.split('+')[0])")
93- uvpip install wget packaging
93+ uv pip install wget packaging
9494 python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
9595 for fpath in `ls requirements/**/*.txt`; do \
9696 python ./adjust-torch-versions.py $fpath ${PYTORCH_VERSION}; \
9797 done
9898
9999 if [ "${PACKAGE_NAME}" == "fabric" ]; then
100100 echo "Replaced PL imports"
101- uvpip install --upgrade -r .actions/requirements.txt
101+ uv pip install --upgrade -r .actions/requirements.txt
102102 python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_fabric" \
103103 --source_import="lightning.fabric" \
104104 --target_import="lightning_fabric"
@@ -108,7 +108,7 @@ run: |
108108 fi
109109
110110 extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
111- uvpip install -e ".[${extra}dev]" --upgrade --find-links="${TORCH_URL}"
111+ uv pip install -e ".[${extra}dev]" --upgrade --find-links="${TORCH_URL}"
112112
113113 python requirements/collect_env_details.py
114114 python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"
0 commit comments