@@ -78,13 +78,19 @@ jobs:
7878 - name : Pull legacy checkpoints
7979 run : bash .actions/pull_legacy_checkpoints.sh
8080
81+ - run : |
82+ flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
83+ url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)
84+ echo "PIP_FLAG=$flag" >> $GITHUB_ENV
85+ echo "TORCH_URL="https://download.pytorch.org/whl/${url}" >> $GITHUB_ENV
86+
8187 - name : Install dependencies
8288 env :
8389 PACKAGE_NAME : pytorch
8490 run : |
8591 flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
8692 url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)
87- pip install -e .[test] --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}"
93+ pip install -e .[test] $PIP_FLAG --find-links "$TORCH_URL" -U --upgrade-strategy eager
8894 pip list
8995 shell : bash
9096
96102 run : |
97103 # adjust versions according installed Torch version
98104 python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt
99- pip install --requirement ./requirements/pytorch/extra.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html -- upgrade
105+ pip install $PIP_FLAG -r ./requirements/pytorch/extra.txt --find-links "$TORCH_URL" -U -- upgrade-strategy eager
100106 pip list
101107 shell : bash
102108
@@ -142,7 +148,7 @@ jobs:
142148 run : |
143149 # adjust versions according installed Torch version
144150 python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt
145- pip install -r requirements/pytorch/examples.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
151+ pip install $PIP_FLAG -r requirements/pytorch/examples.txt --find-links "$TORCH_URL --upgrade
146152
147153 - name : Run Examples
148154 working-directory : ./examples
0 commit comments