@@ -71,23 +71,29 @@ jobs:
71
71
# only Pytorch has/uses notebooks
72
72
submodules : ${{ matrix.pkg-name == 'pytorch' }}
73
73
lfs : ${{ matrix.pkg-name == 'pytorch' }}
74
- - uses : actions/setup-python@v6
74
+
75
+ - name : Install uv and set Python version
76
+ uses : astral-sh/setup-uv@v6
75
77
with :
76
78
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
77
83
78
84
- name : List notebooks
79
85
if : ${{ matrix.pkg-name == 'pytorch' }}
80
86
working-directory : _notebooks/
81
87
run : |
82
- pip install -q py-tree
88
+ uv pip install -q py-tree
83
89
py-tree .notebooks/
84
90
ls -lhR .notebooks/
85
91
86
92
- name : Pull sphinx template
87
93
run : |
88
- pip install -q -r requirements/ci.txt
94
+ uv pip install -q -r requirements/ci.txt
89
95
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
90
- pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
96
+ uv pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
91
97
92
98
- name : pip wheels cache
93
99
uses : actions/cache/restore@v4
@@ -101,25 +107,29 @@ jobs:
101
107
run : |
102
108
sudo apt-get update --fix-missing
103
109
sudo apt-get install -y pandoc
110
+
104
111
- name : Install package & dependencies
105
112
timeout-minutes : 20
106
113
run : |
107
114
mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
108
115
ls -lh ${PYPI_CACHE_DIR}
109
- pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
116
+ uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
110
117
-f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} --extra-index-url="${TORCH_URL}"
111
- pip list
118
+ uv pip list
119
+
112
120
- name : Install req. for Notebooks/tutorials
113
121
if : matrix.pkg-name == 'pytorch'
114
122
timeout-minutes : 10
115
- run : pip install -q -r _notebooks/.actions/requires.txt
123
+ run : uv pip install -q -r _notebooks/.actions/requires.txt
116
124
117
125
- name : Full build for deployment
118
126
if : github.event_name != 'pull_request'
119
127
run : echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
128
+
120
129
- name : Build without warnings
121
130
if : github.event_name != 'workflow_dispatch'
122
131
run : echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
132
+
123
133
- name : Make ${{ matrix.target }}
124
134
working-directory : ./docs/source-${{ matrix.pkg-name }}
125
135
# allow failing link check and doctest if you run with dispatch
@@ -129,6 +139,7 @@ jobs:
129
139
- name : Keep artifact
130
140
if : github.event_name == 'pull_request'
131
141
run : echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
142
+
132
143
- name : Upload built docs
133
144
if : ${{ matrix.target == 'html' }}
134
145
uses : actions/upload-artifact@v4
0 commit comments