Skip to content

Commit b620a86

Browse files
authored
Fix prerelease CI (#2877)
1 parent ced4d89 commit b620a86

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/python-prerelease.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- "v*.rc*"
77

88
jobs:
9-
test_on_transformers:
9+
trigger_rc_testing:
1010
runs-on: ubuntu-latest
1111

1212
strategy:
@@ -32,6 +32,15 @@ jobs:
3232
git config user.name "Hugging Face Bot (RC Testing)"
3333
git config user.email "[email protected]"
3434
35+
- name: Wait for prerelease to be out on PyPI
36+
run: |
37+
VERSION=${{ steps.get-version.outputs.VERSION }}
38+
echo "Waiting for huggingface-hub==${VERSION} to be available on PyPI"
39+
while ! pip install huggingface-hub==${VERSION}; do
40+
echo "huggingface-hub==${VERSION} not available yet, retrying in 15s"
41+
sleep 15
42+
done
43+
3544
- name: Create test branch and update dependencies
3645
id: create-pr
3746
run: |
@@ -43,21 +52,25 @@ jobs:
4352
git checkout -b $BRANCH_NAME
4453
4554
# Update dependencies using sed
46-
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub==${VERSION}"/' setup.py
55+
sed -i -E "s/\"huggingface-hub>=0.*\"/\"huggingface-hub==${VERSION}\"/" setup.py
4756
git add setup.py
4857
4958
# Only if the target repo is transformers
5059
if [ "${{ matrix.target-repo }}" = "transformers" ]; then
51-
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub==${VERSION}"/' src/transformers/dependency_versions_table.py
60+
sed -i -E "s/\"huggingface-hub>=0.*\"/\"huggingface-hub==${VERSION}\"/" src/transformers/dependency_versions_table.py
5261
git add src/transformers/dependency_versions_table.py
5362
fi
5463
5564
# Only if the target repo is diffusers
5665
if [ "${{ matrix.target-repo }}" = "diffusers" ]; then
57-
sed -i -E 's/"huggingface-hub":.*/"huggingface-hub": "huggingface-hub==${VERSION}",/' src/diffusers/dependency_versions_table.py
66+
sed -i -E "s/\"huggingface-hub\":.*/\"huggingface-hub\": \"huggingface-hub==${VERSION}\",/" src/diffusers/dependency_versions_table.py
5867
git add src/diffusers/dependency_versions_table.py
5968
fi
6069
70+
# Any line with `uv pip install --prerelease=allow` in the `.github/` folder must be updated with `--prerelease=allow` flag
71+
find .github/workflows/ -type f -exec sed -i 's/uv pip install /uv pip install --prerelease=allow /g' {} +
72+
git add .github/workflows/
73+
6174
# Commit and push changes
6275
git --no-pager diff --staged
6376
git commit -m "Test hfh ${VERSION}"
@@ -67,4 +80,4 @@ jobs:
6780
run: |
6881
VERSION=${{ steps.get-version.outputs.VERSION }}
6982
echo "https://github.com/huggingface/${{ matrix.target-repo }}/actions"
70-
echo "https://github.com/huggingface/${{ matrix.target-repo }}/compare/main...ci-test-huggingface-hub-${VERSION}"
83+
echo "https://github.com/huggingface/${{ matrix.target-repo }}/compare/main...ci-test-huggingface-hub-${VERSION}"

0 commit comments

Comments
 (0)