diff --git a/.github/unittest/linux/scripts/run_all.sh b/.github/unittest/linux/scripts/run_all.sh index 056b0adcfad..5c6a31601fb 100755 --- a/.github/unittest/linux/scripts/run_all.sh +++ b/.github/unittest/linux/scripts/run_all.sh @@ -222,16 +222,16 @@ export pybind11_DIR # install tensordict if [[ "$RELEASE" == 0 ]]; then - uv_pip_install --no-build-isolation git+https://github.com/pytorch/tensordict.git + uv_pip_install --no-build-isolation --no-deps git+https://github.com/pytorch/tensordict.git else - uv_pip_install tensordict + uv_pip_install --no-deps tensordict fi printf "* Installing torchrl\n" if [[ "$RELEASE" == 0 ]]; then uv_pip_install -e . --no-build-isolation --no-deps else - uv_pip_install -e . --no-build-isolation + uv_pip_install -e . --no-build-isolation --no-deps fi if [ "${CU_VERSION:-}" != cpu ] ; then diff --git a/.github/unittest/linux_libs/scripts_minari/install.sh b/.github/unittest/linux_libs/scripts_minari/install.sh index 649cdd28343..d9bbee6276f 100755 --- a/.github/unittest/linux_libs/scripts_minari/install.sh +++ b/.github/unittest/linux_libs/scripts_minari/install.sh @@ -44,16 +44,16 @@ fi # install tensordict if [[ "$RELEASE" == 0 ]]; then - uv pip install git+https://github.com/pytorch/tensordict.git + uv pip install --no-deps git+https://github.com/pytorch/tensordict.git else - uv pip install tensordict + uv pip install --no-deps tensordict fi # smoke test python -c "import functorch;import tensordict" printf "* Installing torchrl\n" -python -m pip install -e . --no-build-isolation +uv pip install -e . --no-build-isolation --no-deps # smoke test python -c "import torchrl" diff --git a/.github/unittest/linux_sota/scripts/run_all.sh b/.github/unittest/linux_sota/scripts/run_all.sh index 9b780641408..226fe49f6a8 100755 --- a/.github/unittest/linux_sota/scripts/run_all.sh +++ b/.github/unittest/linux_sota/scripts/run_all.sh @@ -132,13 +132,13 @@ python -c "import functorch" # install tensordict if [[ "$RELEASE" == 0 ]]; then - uv pip install git+https://github.com/pytorch/tensordict.git + uv pip install --no-deps git+https://github.com/pytorch/tensordict.git else - uv pip install tensordict + uv pip install --no-deps tensordict fi printf "* Installing torchrl\n" -uv pip install -e . --no-build-isolation +uv pip install -e . --no-build-isolation --no-deps # ==================================================================================== # # ================================ Run tests ========================================= # diff --git a/README.md b/README.md index a2343d91a70..22ab80425a0 100644 --- a/README.md +++ b/README.md @@ -1089,6 +1089,14 @@ pip install -e tensordict pip install -e rl ``` +If you use `uv` (instead of `pip`) and you have already installed a specific PyTorch build (e.g. nightly), +make sure `uv` doesn't re-resolve dependencies (which can downgrade PyTorch). Use `--no-deps` for the local installs: + +```bash +uv pip install --no-deps -e tensordict +uv pip install --no-deps -e rl +``` + Note that tensordict local build requires `cmake` to be installed via [homebrew](https://brew.sh/) (MacOS) or another package manager such as `apt`, `apt-get`, `conda` or `yum` but NOT `pip`, as well as `pip install "pybind11[global]"`. diff --git a/docs/source/index.rst b/docs/source/index.rst index 6e7ad3aa4f6..cf4f659dca6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -62,6 +62,19 @@ or via a ``git clone`` if you're willing to contribute to the library: $ cd ../rl $ python setup.py develop +If you use ``uv`` and you installed a specific PyTorch build beforehand (e.g. a nightly wheel), +use ``--no-deps`` for the editable installs to prevent dependency re-resolution (and potential PyTorch downgrades): + +.. code-block:: bash + + $ cd path/to/root + $ git clone https://github.com/pytorch/tensordict + $ git clone https://github.com/pytorch/rl + $ cd tensordict + $ uv pip install --no-deps -e . + $ cd ../rl + $ uv pip install --no-deps -e . + Getting started ===============