Skip to content

Commit 32fb15e

Browse files
committed
replace pip with uv
1 parent b29f79f commit 32fb15e

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

.github/workflows/docs-build.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,29 @@ jobs:
7070
# only Pytorch has/uses notebooks
7171
submodules: ${{ matrix.pkg-name == 'pytorch' }}
7272
lfs: ${{ matrix.pkg-name == 'pytorch' }}
73-
- uses: actions/setup-python@v6
73+
74+
- name: Install uv and set Python version
75+
uses: astral-sh/setup-uv@v6
7476
with:
7577
python-version: "3.10"
78+
# TODO: Avoid activating environment like this
79+
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
80+
activate-environment: true
81+
enable-cache: true
7682

7783
- name: List notebooks
7884
if: ${{ matrix.pkg-name == 'pytorch' }}
7985
working-directory: _notebooks/
8086
run: |
81-
pip install -q py-tree
87+
uv pip install -q py-tree
8288
py-tree .notebooks/
8389
ls -lhR .notebooks/
8490
8591
- name: Pull sphinx template
8692
run: |
87-
pip install -q -r requirements/ci.txt
93+
uv pip install -q -r requirements/ci.txt
8894
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
89-
pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
95+
uv pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
9096
9197
- name: pip wheels cache
9298
uses: actions/cache/restore@v4
@@ -100,25 +106,29 @@ jobs:
100106
run: |
101107
sudo apt-get update --fix-missing
102108
sudo apt-get install -y pandoc
109+
103110
- name: Install package & dependencies
104111
timeout-minutes: 20
105112
run: |
106113
mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
107114
ls -lh ${PYPI_CACHE_DIR}
108-
pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
115+
uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
109116
-f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} --extra-index-url="${TORCH_URL}"
110-
pip list
117+
uv pip list
118+
111119
- name: Install req. for Notebooks/tutorials
112120
if: matrix.pkg-name == 'pytorch'
113121
timeout-minutes: 10
114-
run: pip install -q -r _notebooks/.actions/requires.txt
122+
run: uv pip install -q -r _notebooks/.actions/requires.txt
115123

116124
- name: Full build for deployment
117125
if: github.event_name != 'pull_request'
118126
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
127+
119128
- name: Build without warnings
120129
if: github.event_name != 'workflow_dispatch'
121130
run: echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
131+
122132
- name: Make ${{ matrix.target }}
123133
working-directory: ./docs/source-${{ matrix.pkg-name }}
124134
# allow failing link check and doctest if you run with dispatch
@@ -128,6 +138,7 @@ jobs:
128138
- name: Keep artifact
129139
if: github.event_name == 'pull_request'
130140
run: echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
141+
131142
- name: Upload built docs
132143
if: ${{ matrix.target == 'html' }}
133144
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)