@@ -67,26 +67,33 @@ jobs:
6767 - uses : actions/checkout@v5
6868 with :
6969 ref : ${{ inputs.checkout }}
70+ token : ${{ secrets.GITHUB_TOKEN }}
7071 # only Pytorch has/uses notebooks
7172 submodules : ${{ matrix.pkg-name == 'pytorch' }}
7273 lfs : ${{ matrix.pkg-name == 'pytorch' }}
73- - uses : actions/setup-python@v6
74+
75+ - name : Install uv and set Python version
76+ uses : astral-sh/setup-uv@v6
7477 with :
7578 python-version : " 3.10"
79+ # TODO: Avoid activating environment like this
80+ # see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
81+ activate-environment : true
82+ enable-cache : true
7683
7784 - name : List notebooks
7885 if : ${{ matrix.pkg-name == 'pytorch' }}
7986 working-directory : _notebooks/
8087 run : |
81- pip install -q py-tree
88+ uv pip install -q py-tree
8289 py-tree .notebooks/
8390 ls -lhR .notebooks/
8491
8592 - name : Pull sphinx template
8693 run : |
87- pip install -q -r requirements/ci.txt
94+ uv pip install -q -r requirements/ci.txt
8895 aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
89- pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
96+ uv pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
9097
9198 - name : pip wheels cache
9299 uses : actions/cache/restore@v4
@@ -100,25 +107,29 @@ jobs:
100107 run : |
101108 sudo apt-get update --fix-missing
102109 sudo apt-get install -y pandoc
110+
103111 - name : Install package & dependencies
104112 timeout-minutes : 20
105113 run : |
106114 mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
107115 ls -lh ${PYPI_CACHE_DIR}
108- pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
116+ uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
109117 -f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} --extra-index-url="${TORCH_URL}"
110- pip list
118+ uv pip list
119+
111120 - name : Install req. for Notebooks/tutorials
112121 if : matrix.pkg-name == 'pytorch'
113122 timeout-minutes : 10
114- run : pip install -q -r _notebooks/.actions/requires.txt
123+ run : uv pip install -q -r _notebooks/.actions/requires.txt
115124
116125 - name : Full build for deployment
117126 if : github.event_name != 'pull_request'
118127 run : echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
128+
119129 - name : Build without warnings
120130 if : github.event_name != 'workflow_dispatch'
121131 run : echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
132+
122133 - name : Make ${{ matrix.target }}
123134 working-directory : ./docs/source-${{ matrix.pkg-name }}
124135 # allow failing link check and doctest if you run with dispatch
@@ -128,6 +139,7 @@ jobs:
128139 - name : Keep artifact
129140 if : github.event_name == 'pull_request'
130141 run : echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
142+
131143 - name : Upload built docs
132144 if : ${{ matrix.target == 'html' }}
133145 uses : actions/upload-artifact@v4
0 commit comments