Skip to content

Commit e1d3fd4

Browse files
committed
[CI] Fix wheels
ghstack-source-id: 0f26021 Pull Request resolved: #2876
1 parent e80732e commit e1d3fd4

8 files changed

+40
-2
lines changed
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
pip install --upgrade setuptools
4+
5+
export TORCHRL_BUILD_VERSION=0.7.0
6+
7+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U

.github/scripts/pre-build-script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
pip install --upgrade setuptools
4+
5+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U

.github/scripts/td_script.sh

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
#!/bin/bash
22

33
export TORCHRL_BUILD_VERSION=0.7.0
4+
pip install --upgrade setuptools
45

5-
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U
6+
# Check if ARCH is set to aarch64
7+
ARCH=${ARCH:-} # This sets ARCH to an empty string if it's not defined
8+
9+
if pip list | grep -q torch; then
10+
echo "Torch is installed."
11+
if [[ "$ARCH" == "aarch64" ]]; then
12+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U --no-deps
13+
else
14+
${CONDA_RUN} pip install tensordict-nightly -U
15+
fi
16+
elif [[ -n "${SMOKE_TEST_SCRIPT:-}" ]]; then
17+
${CONDA_RUN} ${PIP_INSTALL_TORCH}
18+
if [[ "$ARCH" == "aarch64" ]]; then
19+
${CONDA_RUN} pip install git+https://github.com/pytorch/tensordict.git -U --no-deps
20+
else
21+
${CONDA_RUN} pip install tensordict-nightly -U
22+
fi
23+
else
24+
echo "Torch is not installed - tensordict will be installed later."
25+
fi

.github/scripts/version_script.bat

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat
3636

3737
set DISTUTILS_USE_SDK=1
3838

39+
:: Upgrade setuptools before installing PyTorch
40+
pip install --upgrade setuptools==72.1.0 || exit /b 1
41+
3942
set args=%1
4043
shift
4144
:start

.github/workflows/build-wheels-aarch64-linux.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- repository: pytorch/rl
3636
smoke-test-script: test/smoke_test.py
3737
package-name: torchrl
38+
pre-script: .github/scripts/pre-build-script.sh
3839
name: pytorch/rl
3940
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
4041
with:

.github/workflows/build-wheels-linux.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- repository: pytorch/rl
3535
smoke-test-script: test/smoke_test.py
3636
package-name: torchrl
37+
pre-script: .github/scripts/pre-build-script.sh
3738
name: pytorch/rl
3839
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
3940
with:

.github/workflows/build-wheels-m1.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
- repository: pytorch/rl
3535
smoke-test-script: test/smoke_test.py
3636
package-name: torchrl
37+
pre-script: .github/scripts/pre-build-script.sh
3738
name: ${{ matrix.repository }}
3839
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
3940
with:

.github/workflows/build-wheels-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
matrix:
3333
include:
3434
- repository: pytorch/rl
35-
pre-script: .github/scripts/td_script.sh
35+
pre-script: .github/scripts/pre-build-script-win.sh
3636
env-script: .github/scripts/version_script.bat
3737
post-script: "python packaging/wheel/relocate.py"
3838
smoke-test-script: test/smoke_test.py

0 commit comments

Comments
 (0)